Jump to content


Photo

Subtitles folder

subtitle

  • Please log in to reply
24 replies to this topic

#21 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 142356 posts
  • Local time: 12:56 AM

Posted 15 August 2019 - 03:22 PM

@Luke could it have anything to do with the "unknown" in created as shown in images in post 16?

 

@Happy2Play, sorry I must be having a blind moment, but what do you mean exactly?



#22 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 142356 posts
  • Local time: 12:56 AM

Posted 15 August 2019 - 03:24 PM

I believe the issue is casing. We are looking for folders with lower case names, and on linux that will make a difference.



#23 visualblind OFFLINE  

visualblind

    Member

  • Members
  • 10 posts
  • Local time: 10:56 PM

Posted 18 August 2019 - 10:07 AM

I believe the issue is casing. We are looking for folders with lower case names, and on linux that will make a difference.

@Luke You were correct after-all, and your one-hundred-thirty-four-thousand posts on here tells me I should not be surprised.

 

It looks like it's only looking for lowercase directories with these two exact names: subs, subtitles
 

It won't even detect subtitles in directories with the following names: sub, Sub, SUB, Subs, SUBS, subtitle, Subtitle, SUBTITLE, Subtitles, SUBTITLES.

On the instance of 4.1.1.0 that I in-place upgraded to 4.2.1.0, I was not able to get the subdirectory-subtitle detection to work like it does on a new 4.2.1.0 instance. That included creating new library that contained only a single film with a subdirectory name of 'subs' and 'subtitles'. I'm not sure if it's only me, or everyone whose using this in a non-Windows environment that also takes the same upgrade path. May not want to hear it but I also tested on Jellyfin and doesn't seem to be capable of any subdir detection at all.

 

This may help those in the same situation. Whoever uses it take off "-n" from rename to perform the rename/case transformation:

find . -mount -depth -mindepth 1 -maxdepth 3 -type d ! -empty \( -name 'sub' -o -name 'Sub' -o -name 'SUB' -o -name 'Subs' -o -name 'SUBS' -o -name 'subtitle' -o -name 'Subtitle' -o -name 'SUBTITLE' -o -name 'Subtitles' -o -name 'SUBTITLES' \) -exec rename -n -f -v 's/(.*)\/([^\/]*)/$1\/subs/' {} \;

Sorry forgot how long that one is, here's the shorter ver

find . -mount -depth -mindepth 1 -maxdepth 3 -type d ! -empty \
 \( -name 'sub' -o -name 'Sub' -o -name 'SUB' -o -name 'Subs' -o -name 'SUBS' -o -name 'subtitle' \
 -o -name 'Subtitle' -o -name 'SUBTITLE' -o -name 'Subtitles' -o -name 'SUBTITLES' \) \
 -exec rename -n -f -v 's/(.*)\/([^\/]*)/$1\/subs/' {} \;

*** I wanted to add, for those of you who have an earlier version than Emby 4.2.1.0, the following script should help you move subtitle files out of their respective subtitle directory up one level to its movie directory if your structure is like this:

 

/mnt/path/to/video-movies
├── Movie
│   └── Subs
 
find /mnt/path/to/video-movies -depth -mindepth 3 -maxdepth 4 -type f \
-ipath '*/sub*' \( -iname '*.srt' -o -iname '*.sub' -o -iname '*.idx' \) \
-execdir mv -v "{}" ./.. \;

You may need to run it a few times to "walk" the subtitle files up if you have nested subtitle directories ( ie: movie > subs > srt > subtitle_file.srt ), but it should get the job done.


Edited by visualblind, 20 August 2019 - 02:46 AM.


#24 Karl Blixt OFFLINE  

Karl Blixt

    Advanced Member

  • Members
  • 76 posts
  • Local time: 06:56 AM

Posted 18 August 2019 - 10:21 AM

Could information about this feature be added to the subtitle page in the emby wiki?



#25 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 142356 posts
  • Local time: 12:56 AM

Posted 18 August 2019 - 10:23 AM

Yes @cayars.





Also tagged with one or more of these keywords: subtitle

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users