Skip to content
This repository has been archived by the owner on Jun 14, 2019. It is now read-only.

Commit

Permalink
Merge pull request #2 from lpgera/subtitles_folder
Browse files Browse the repository at this point in the history
added subtitles folder to settings
  • Loading branch information
brainfoolong authored Dec 4, 2016
2 parents e1c2c77 + c212620 commit 9a1c2d4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
14 changes: 12 additions & 2 deletions omx-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@ then
rm $1
fi
mkfifo $1
omxplayer -b "$2" -o $4 --vol $5 < $1 &

# check if subtitle file exists in subtitle folder
basename=$(basename $2)
subtitle_path="$6/${basename%.*}.srt"
if [ -e "$subtitle_path" ]; then
subtitle_argument="--subtitles $subtitle_path"
else
subtitle_argument=""
fi

omxplayer -b "$2" -o $4 --vol $5 $subtitle_argument < $1 &
echo -n "." > $1 &

# fix for double play speed at start
if [ "$3" = "1" ]; then
echo -n "1" > $1 &
fi
fi
5 changes: 4 additions & 1 deletion src/Translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ class Translation
"settings.resetflags.desc" => "Delete all seen flags from all videos with just one click",
"settings.hidefolder.title" => "Hide folder names in playlist",
"settings.hidefolder.desc" => "Enable a more compact view for the playlist by hiding the folder names",

"settings.subtitlesfolder.title" => "Subtitles folder",
"settings.subtitlesfolder.desc" => "If you would like to keep your subtitle files in a separate place from your media files, you can provide the folder here.",
],
"de" => [
"shortcut-q" => "Stoppe\nPlayer",
Expand Down Expand Up @@ -134,6 +135,8 @@ class Translation
"settings.resetflags.desc" => "Lösche alle gesehen Flags mit einem Klick",
"settings.hidefolder.title" => "Verstecke Ordnername in Wiedergabeliste",
"settings.hidefolder.desc" => "Aktiviere eine kompaktere Ansicht mit dieser Option",
"settings.subtitlesfolder.title" => "Untertitel Ordner",
"settings.subtitlesfolder.desc" => "Wenn Sie Ihre Untertitel-Dateien an einem anderen Ort aus Ihren Mediendateien speichern möchten, können Sie den Ordner hier angeben.",
]
];
}
4 changes: 3 additions & 1 deletion src/View/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public function load()
isset($settings["speedfix"]) && $settings["speedfix"] ? "1"
: "0",
isset($settings["audioout"]) ? $settings["audioout"] : "hdmi",
isset($settings["initvol"]) ? $settings["initvol"] * 100 : "0"
isset($settings["initvol"]) ? $settings["initvol"] * 100 : "0",
isset($settings["subtitles_folder"]) ? "'" .
$settings["subtitles_folder"] . "'" : false,
];
$startCmd = escapeshellarg($path) . " " . implode(" ", $params);
switch (post("shortcut")) {
Expand Down
11 changes: 11 additions & 0 deletions src/View/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ class="form-control">
<option value="de">Deutsch</option>
</select>
</div>

<div class="title spacer">
<strong><?= t("settings.subtitlesfolder.title") ?></strong>
<small><?= t("settings.subtitlesfolder.desc") ?></small>
</div>
<div class="spacer">
<input type="text"
placeholder="<?= t("settings.subtitlesfolder.title") ?>"
name="setting[subtitles_folder]"
class="form-control">
</div>
<input type="submit" value="<?= t("save") ?>" name="save"
class="btn btn-default btn-info">
</form>
Expand Down

0 comments on commit 9a1c2d4

Please sign in to comment.