Bug 499780

Summary: Additional subtitle folder detection
Product: [Applications] Haruna Reporter: dougg0k
Component: genericAssignee: george fb <georgefb899>
Status: RESOLVED FIXED    
Severity: normal CC: ilikefoss
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description dougg0k 2025-02-10 21:11:15 UTC
Hi,

I recently encountered a tv show with had a folder Subs inside with the videos. But inside the Subs folder, had a folder for each of the video, with the name of the video, and multiple srt subs.

/
/Epis01.mkv
/Subs/Epis01/2_English.srt

But those were not detected by the player.

Could you add an additional way to detect based on that pattern?

It's not possible to add in the Settings, since it's based on and per episode. 

Thanks.
Comment 1 John 2025-02-16 05:15:05 UTC
Have you tried to change the 'subs' folder in the settings to 'Subs'?
Or to './Subs'?
Or add a new one like that besides the default 'subs' folder?
Comment 2 dougg0k 2025-02-16 05:20:08 UTC
Yes.

That setting only consider sub files to be inside them, not to identify based on names of further folders and subs inside it.
Comment 3 george fb 2025-02-26 08:10:33 UTC
Git commit b0d9b1a346cb2e22a12a390fe1880be3b5e2845c by George Florea Bănuș.
Committed on 26/02/2025 at 07:52.
Pushed by georgefb into branch 'master'.

mpvitem: search subtitles recursively

searches folders relative to the parent folder of the playing file
and only folders defined by the `subtitlesFolders` setting
The subtitles path must contain the name of the playing file (without extension)

If the playing file is "/home/haruna/Videos/video1.mkv" and `subtitlesFolders` contains
the folders "subs" and "subtitles" then subtitles will be searched in
"/home/haruna/Videos/subs/*" and "/home/haruna/Videos/subtitles/*"

Both "/home/haruna/Videos/subtitles/video1/sub.srt"
and  "/home/haruna/Videos/subtitles/folder1/video1.srt" are a match
since their path contains the name of the playing video "video1"

M  +9    -0    src/mpv/mpvitem.cpp
M  +43   -0    src/worker.cpp
M  +2    -0    src/worker.h

https://invent.kde.org/multimedia/haruna/-/commit/b0d9b1a346cb2e22a12a390fe1880be3b5e2845c
Comment 4 george fb 2025-02-26 08:10:41 UTC
Git commit 903f8ca91af3a9e7a5dbd2e948848b135d70daed by George Florea Bănuș.
Committed on 26/02/2025 at 08:10.
Pushed by georgefb into branch 'master'.

SubtitlesSettings: add setting for recursive subtitle search

M  +3    -1    src/mpv/mpvitem.cpp
M  +35   -7    src/qml/Haruna/Components/SubtitlesFolders.qml
M  +1    -1    src/qml/Settings/SubtitlesSettings.qml
M  +3    -0    src/settings/subtitlessettings.kcfg

https://invent.kde.org/multimedia/haruna/-/commit/903f8ca91af3a9e7a5dbd2e948848b135d70daed