Skip to content

Commit

Permalink
edited setting names + updated minAppVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
zuluwi committed Mar 7, 2024
1 parent ab36745 commit cb60883
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 86 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "vlc-bridge",
"name": "VLC Bridge",
"version": "0.0.7",
"minAppVersion": "0.15.0",
"minAppVersion": "1.4.11",
"description": "It allows you to control VLC Player via Obsidian and add a timestamped link or snapshot from the current video to your note. By clicking on these timestamped links, you can reopen the video at the specified time in VLC Player.",
"author": "zuluwi",
"authorUrl": "https://github.com/zuluwi",
Expand Down
28 changes: 14 additions & 14 deletions src/language/locale/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {
"Snapshot not found, if you made a change to the snapshot folder name, try restarting VLC.",

/* settings */
"VLC Path": "VLC Path",
"VLC path": "VLC path",
"Select 'vlc.exe' from the folder where VLC Player is installed": "Select 'vlc.exe' from the folder where VLC Player is installed",
"Select vlc.exe": "Select vlc.exe",
Port: "Port",
Expand All @@ -38,22 +38,22 @@ export default {
"Allows you to open more precise (sub-second) time values. It is recommended to enable this option if you want to open exactly the same frame as when you get the link.":
"Allows you to open more precise (sub-second) time values. It is recommended to enable this option if you want to open exactly the same frame as when you get the link.",
"Show 'open video' icon in the sidebar": "Show 'open video' icon in the sidebar",
"Timestamp Offset": "Timestamp Offset",
"Timestamp offset (in seconds)": "Timestamp offset (in seconds)",
//
"Link Templates": "Link Templates",
"Timestamp Link": "Timestamp Link",
"Timestamp Linktext": "Timestamp Linktext",
"Timestamp Template": "Timestamp Template",
"Snapshot Embed": "Snapshot Embed",
"Snapshot Path": "Snapshot Path",
"Snapshot Linktext": "Snapshot Linktext",
"Snapshot Template": "Snapshot Template",
"Link templates": "Link templates",
"Timestamp link": "Timestamp link",
"Timestamp linktext": "Timestamp linktext",
"Timestamp template": "Timestamp template",
"Snapshot embed": "Snapshot embed",
"Snapshot path": "Snapshot path",
"Snapshot linktext": "Snapshot linktext",
"Snapshot template": "Snapshot template",
Placeholders: "Placeholders",
//
"Seeking Amounts": "Seeking Amounts",
"Normal Seek Amount (in seconds)": "Normal Seek Amount (in seconds)",
"Seeking amounts": "Seeking amounts",
"Normal seek amount (in seconds)": "Normal seek amount (in seconds)",
"Set the seek amount for 'Seek forward/backward' commands": "Set the seek amount for 'Seek forward/backward' commands",
"Long Seek Amount (in seconds)": "Long Seek Amount (in seconds)",
"Long seek amount (in seconds)": "Long seek amount (in seconds)",
"Set the seek amount for 'Long seek forward/backward' commands": "Set the seek amount for 'Long seek forward/backward' commands",
//
Snapshot: "Snapshot",
Expand All @@ -63,7 +63,7 @@ export default {
"Snapshot Format": "Snapshot Format",
"Select the image format in which the snapshots will be saved": "Select the image format in which the snapshots will be saved",
//
"Syncplay Path": "Syncplay Path",
"Syncplay path": "Syncplay path",
"Select 'Syncplay.exe' from the folder where Syncplay is installed": "Select 'Syncplay.exe' from the folder where Syncplay is installed",
"Select Syncplay.exe": "Select Syncplay.exe",
"Start Syncplay with plugin arguments": "Start Syncplay with plugin arguments",
Expand Down
32 changes: 16 additions & 16 deletions src/language/locale/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {
"Snapshot bulunamadı, eğer snapshot klasörü adında bir değişiklik yaptıysanız VLC'yi yeniden başlatmayı deneyiniz.",

/* settings */
"VLC Path": "VLC Yolu",
"VLC path": "VLC dosya yolu",
"Select 'vlc.exe' from the folder where VLC Player is installed": "VLC Player'ın kurulu olduğu klasörden vlc.exe'yi seçiniz",
"Select vlc.exe": "vlc.exe'yi seç",
Port: "Port",
Expand All @@ -38,25 +38,25 @@ export default {
"Allows you to open more precise (sub-second) time values. It is recommended to enable this option if you want to open exactly the same frame as when you get the link.":
"Daha isabetli zaman değerlerini açmanıza olanak tanır. Eğer tam olarak link aldığınızdaki aynı kareyi açmak istiyorsanız bu ayarı kullanmanız önerilir.",
"Show 'open video' icon in the sidebar": "Yan çubukta 'video aç' ikonunu göster",
"Timestamp Offset": "Zaman Damgası Gecikmesi",
"Timestamp offset (in seconds)": "Zaman damgası gecikmesi (saniye cinsinden)",
//
"Link Templates": "Link Şablonları",
"Timestamp Link": "Zaman Damgası Linki",
"Timestamp Linktext": "Zaman Damgası Link Yazısı",
"Timestamp Template": "Zaman Damgası Şablonu",
"Snapshot Embed": "Snapshot",
"Snapshot Path": "Snapshot Adresi",
"Snapshot Linktext": "Snapshot Açıklaması",
"Snapshot Template": "Snapshot Şablonu",
"Link templates": "Link şablonları",
"Timestamp link": "Zaman damgası linki",
"Timestamp linktext": "Zaman damgası link yazısı",
"Timestamp template": "Zaman damgası şablonu",
"Snapshot embed": "Snapshot",
"Snapshot path": "Snapshot adresi",
"Snapshot linktext": "Snapshot açıklaması",
"Snapshot template": "Snapshot şablonu",
Placeholders: "Kullanılabilir Bilgiler",
//
"Seeking Amounts": "İleri/Geri Sarma Miktarları",
"Normal Seek Amount (in seconds)": "Normal İleri/Geri Sarma Miktarı (saniye cinsinden)",
"Set the seek amount for 'Seek forward/backward' commands": "İleri/Geri Sar komutları için atmala miktarını seçiniz",
"Long Seek Amount (in seconds)": "Uzun İleri/Geri Sarma Miktarı (saniye cinsinden)",
"Set the seek amount for 'Long seek forward/backward' commands": "Uzun İleri/Geri Sar komutları için atmala miktarını seçiniz",
"Seeking amounts": "İleri/Geri sarma miktarları",
"Normal seek amount (in seconds)": "Normal ileri/geri sarma miktarı (saniye cinsinden)",
"Set the seek amount for 'Seek forward/backward' commands": "'İleri/Geri sar' komutları için atmala miktarını seçiniz",
"Long seek amount (in seconds)": "Uzun ileri/geri sarma Miktarı (saniye cinsinden)",
"Set the seek amount for 'Long seek forward/backward' commands": "'Uzun ileri/geri sar' komutları için atmala miktarını seçiniz",
//
"Syncplay Path": "Syncplay Yolu",
"Syncplay path": "Syncplay yolu",
"Select 'Syncplay.exe' from the folder where Syncplay is installed": "Syncplay'in kurulu olduğu klasörden Syncplay.exe'yi seçiniz",
"Select Syncplay.exe": "Syncplay.exe'yi seç",
"Start Syncplay with plugin arguments": "Plugin argümanlarıyla Syncplay'i çalıştır",
Expand Down
75 changes: 28 additions & 47 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import { t } from "./language/helpers";
import { currentConfig } from "./vlcHelper";
import isPortReachable from "is-port-reachable";

declare module "obsidian" {
interface DataAdapter {
getFullRealPath(arg: string): string;
}
}
export interface VBPluginSettings {
port: number;
password: string;
Expand Down Expand Up @@ -117,7 +112,7 @@ export class VBPluginSettingsTab extends PluginSettingTab {
createFragment((el) => {
MarkdownRenderer.render(
this.app,
`## \\!\\[[ {{${t("Snapshot Path")}}} | **${this.plugin.settings.snapshotLinktext}** ]] \n#### ${t("Placeholders")} \n- \`{{filename}}\` \n- \`{{timestamp}}\` \n`,
`## \\!\\[[ {{${t("Snapshot path")}}} | **${this.plugin.settings.snapshotLinktext}** ]] \n#### ${t("Placeholders")} \n- \`{{filename}}\` \n- \`{{timestamp}}\` \n`,
el.createDiv(),
"",
this.plugin
Expand All @@ -128,7 +123,7 @@ export class VBPluginSettingsTab extends PluginSettingTab {

let selectVLCDescEl: HTMLElement;
const selectVLC = new Setting(containerEl)
.setName(t("VLC Path"))
.setName(t("VLC path"))
.setDesc(t("Select 'vlc.exe' from the folder where VLC Player is installed"))
.addButton((btn) => {
btn.setButtonText(t("Select vlc.exe")).onClick(() => {
Expand Down Expand Up @@ -218,7 +213,7 @@ export class VBPluginSettingsTab extends PluginSettingTab {
let tsOffsetSlider: SliderComponent;
let tsOffsetText: TextComponent;
new Setting(containerEl)
.setName(t("Timestamp Offset"))
.setName(t("Timestamp offset (in seconds)"))
.addSlider((slider) => {
tsOffsetSlider = slider;
slider
Expand All @@ -235,26 +230,21 @@ export class VBPluginSettingsTab extends PluginSettingTab {
.addText((text) => {
tsOffsetText = text;
text.setValue(this.plugin.settings.timestampOffset.toString()).onChange(async (value) => {
if (!Number.isInteger(Number(value))) {
text.inputEl.addClass("warning");
} else {
text.inputEl.removeClass("warning");
this.plugin.settings.timestampOffset = Number(value);
await this.plugin.saveSettings();
tsOffsetSlider.setValue(this.plugin.settings.timestampOffset);
}
this.plugin.settings.timestampOffset = Number(value);
await this.plugin.saveSettings();
tsOffsetSlider.setValue(this.plugin.settings.timestampOffset);
});

text.inputEl.type = "number";
text.inputEl.addClasses(["vlc-bridge-text-input", "number"]);
});
}

new Setting(containerEl).setName(t("Link Templates")).setHeading();
new Setting(containerEl).setName(t("Link templates")).setHeading();

new Setting(containerEl).setName(t("Timestamp Link")).setHeading();
new Setting(containerEl).setName(t("Timestamp link")).setHeading();

const tsLinkTextSetting = new Setting(containerEl)
.setName(t("Timestamp Linktext"))
.setName(t("Timestamp linktext"))
.addText((text) => {
text
.setPlaceholder(this.plugin.settings.timestampLinktext)
Expand All @@ -276,7 +266,7 @@ export class VBPluginSettingsTab extends PluginSettingTab {
);

new Setting(containerEl)
.setName(t("Timestamp Template"))
.setName(t("Timestamp template"))
.setDesc(
createFragment((el) => {
MarkdownRenderer.render(this.app, `#### ${t("Placeholders")} \n- \`{{timestamplink}}\` \n- \`{{filename}}\` \n- \`{{timestamp}}\`\n`, el.createDiv(), "", this.plugin);
Expand Down Expand Up @@ -304,10 +294,10 @@ export class VBPluginSettingsTab extends PluginSettingTab {
})
);

containerEl.createEl("h2", { text: t("Snapshot Embed") });
containerEl.createEl("h2", { text: t("Snapshot embed") });

const ssLinkTextSetting = new Setting(containerEl)
.setName(t("Snapshot Linktext"))
.setName(t("Snapshot linktext"))
.addText((text) => {
text
.setPlaceholder(this.plugin.settings.snapshotLinktext)
Expand All @@ -327,7 +317,7 @@ export class VBPluginSettingsTab extends PluginSettingTab {
})
);
new Setting(containerEl)
.setName(t("Snapshot Template"))
.setName(t("Snapshot template"))
.setDesc(
createFragment((el) => {
MarkdownRenderer.render(
Expand Down Expand Up @@ -361,12 +351,12 @@ export class VBPluginSettingsTab extends PluginSettingTab {
})
);

new Setting(containerEl).setName(t("Seeking Amounts")).setHeading();
new Setting(containerEl).setName(t("Seeking amounts")).setHeading();

let seekOffsetSlider: SliderComponent;
let seekOffsetText: TextComponent;
new Setting(containerEl)
.setName(t("Normal Seek Amount (in seconds)"))
.setName(t("Normal seek amount (in seconds)"))
.setDesc(t("Set the seek amount for 'Seek forward/backward' commands"))
.addSlider((slider) => {
seekOffsetSlider = slider;
Expand All @@ -383,28 +373,23 @@ export class VBPluginSettingsTab extends PluginSettingTab {
.addText((text) => {
seekOffsetText = text;
text.setValue(this.plugin.settings.normalSeek.toString()).onChange(async (value) => {
if (!Number.isInteger(Number(value))) {
text.inputEl.addClass("warning");
} else {
text.inputEl.removeClass("warning");
this.plugin.settings.normalSeek = Number(value);
await this.plugin.saveSettings();
seekOffsetSlider.setValue(this.plugin.settings.normalSeek);
}
this.plugin.settings.normalSeek = Number(value);
await this.plugin.saveSettings();
seekOffsetSlider.setValue(this.plugin.settings.normalSeek);
});

text.inputEl.type = "number";
text.inputEl.addClasses(["vlc-bridge-text-input", "number"]);
});

let longSeekOffsetSlider: SliderComponent;
let longSeekOffsetText: TextComponent;
new Setting(containerEl)
.setName(t("Long Seek Amount (in seconds)"))
.setName(t("Long seek amount (in seconds)"))
.setDesc(t("Set the seek amount for 'Long seek forward/backward' commands"))
.addSlider((slider) => {
longSeekOffsetSlider = slider;
slider
.setLimits(5, 10 * 60, 5)
.setLimits(0, 10 * 60, 5)
.setDynamicTooltip()
.setValue(this.plugin.settings.largeSeek)
.onChange(async (value) => {
Expand All @@ -416,16 +401,12 @@ export class VBPluginSettingsTab extends PluginSettingTab {
.addText((text) => {
longSeekOffsetText = text;
text.setValue(this.plugin.settings.largeSeek.toString()).onChange(async (value) => {
if (!Number.isInteger(Number(value))) {
text.inputEl.addClass("warning");
} else {
text.inputEl.removeClass("warning");
this.plugin.settings.largeSeek = Number(value);
await this.plugin.saveSettings();
longSeekOffsetSlider.setValue(this.plugin.settings.largeSeek);
}
this.plugin.settings.largeSeek = Number(value);
await this.plugin.saveSettings();
longSeekOffsetSlider.setValue(this.plugin.settings.largeSeek);
});

text.inputEl.type = "number";
text.inputEl.step = "5";
text.inputEl.addClasses(["vlc-bridge-text-input", "number"]);
});

Expand Down Expand Up @@ -477,7 +458,7 @@ export class VBPluginSettingsTab extends PluginSettingTab {

let selectSPDescEl: HTMLElement;
const selectSP = new Setting(containerEl)
.setName(t("Syncplay Path"))
.setName(t("Syncplay path"))
.setDesc(t("Select 'Syncplay.exe' from the folder where Syncplay is installed"))
.addButton((btn) => {
btn
Expand Down
5 changes: 5 additions & 0 deletions src/vlcHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import { t } from "./language/helpers";
import { fileURLToPath } from "url";
import isPortReachable from "is-port-reachable";

declare module "obsidian" {
interface DataAdapter {
getFullRealPath(arg: string): string;
}
}
interface config {
port: number | null;
password: string | null;
Expand Down
16 changes: 8 additions & 8 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"0.0.1": "0.15.0",
"0.0.11": "0.15.0",
"0.0.2": "0.15.0",
"0.0.3": "0.15.0",
"0.0.4": "0.15.0",
"0.0.5": "0.15.0",
"0.0.6": "0.15.0",
"0.0.7": "0.15.0"
"0.0.1": "1.4.11",
"0.0.11": "1.4.11",
"0.0.2": "1.4.11",
"0.0.3": "1.4.11",
"0.0.4": "1.4.11",
"0.0.5": "1.4.11",
"0.0.6": "1.4.11",
"0.0.7": "1.4.11"
}

0 comments on commit cb60883

Please sign in to comment.