Menu

#61 Minidlna to detect subtitle with country code

v1.0 (example)
open
nobody
None
5
2020-10-04
2018-04-27
No

Hi.
u/shrimpkin mentioned here https://sourceforge.net/p/minidlna/support-requests/33/
that minidlna can read single subtitles with country code (sr.srt) if metadata.c file is changed
Can someone tell me what need to be changed in that file so minidlna can detect subtitles with sr.srt instead a regular srt..
Movie_file.mkv
Movie_file.sr.srt

Thanks

Discussion

  • Milos Starcevic

    Milos Starcevic - 2018-04-27

    Edit: i added .sr in line 142 and it works
    Before - strcpy(p, ".srt");
    After - strcpy(p, ".sr.srt");

    Edit 2: after testing, i installed fresh debian and minidlna with above solution to force .sr.srt subtitles, and now its not working.. i don't know why was working in the first place..

    Can someone explain me what to edit in metadata.c or can someone make a patch so .sr.srt can be default subtitles..

    Thanks

     

    Last edit: Milos Starcevic 2018-04-30
  • Shrimpkin

    Shrimpkin - 2018-05-01

    The source edit will work. Double check everything, recompile, rebuild db, etc.

    Or just use links. man ln

    ln -s movie.sr.srt movie.srt
    
     
    • Milos Starcevic

      Milos Starcevic - 2018-05-01

      After rebuilding db it's working again.. thanks
      One question.. if i want to install minidlna with apt-get install. can i then edit minidlna files to change .srt to .sr.srt?
      I found that that line is in /usr/local/sbin/minidlnad and changed it with nano to add .sr before .srt, save it, and after that minidlna wont start with service minidlna start.. is it possible to do that?

       
      • Shrimpkin

        Shrimpkin - 2018-05-04

        You need to use a binary editor and will most likely not work.

        Compile source, create a deb package, and install using dpkg. Tutorials are available online.

        FYI, additional code is needed for inotify srt support.

         
        • Milos Starcevic

          Milos Starcevic - 2018-05-10

          u/shrimpkin i have another problem.. i don't know what's going on anymore..i installed
          clean debian and minidlna from source

          When movie file is moved to media_dir, minidlna register this and list that file (that's ok) but subtitles are problem, if subtitles are not moved in the same time with movie file, minidlna will not register subtitles..only after i delete database file and restart minidlna those subtitles will be then registered.. i get my subtitles with script.. and that subtitles are downloaded about 10 seconds after movie is moved to media_dir folder..
          Before i didn't had that issue, and i always downloaded subitltes with script, like i do now..
          this is my steps to install minidlna from source

          metadata.c --- open with notepad++
          strcpy(p, ".srt"); >>> strcpy(p, ".sr.srt"); --- type .sr before .srt

          echo "deb-src http://raspbian.raspberrypi.org/raspbian stretch main contrib non-free rpi" | sudo tee -a /etc/apt/sources.list
          apt-get update
          apt-get build-dep minidlna
          cd /mnt/dietpi_userdata/downloads/minidlna
          ./autogen.sh
          ./configure
          make && make install
          cp minidlna.conf /etc/
          cp linux/minidlna.init.d.script /etc/init.d/minidlna
          chmod +x /etc/init.d/minidlna
          update-rc.d minidlna defaults
          nano /etc/minidlna.conf

          change this settings in minidlna.conf
          media_dir=V,/mnt/dietpi_userdata/Plex/Movies
          friendly_name=DLNA
          root_container=B

          and then reboot.. is there something else i must do? when i move subtitle to movie folder, minidlna log that, but nothing happen

          [2018/05/10 13:12:45] monitor.c:698: debug: The directory /mnt/045abc53-a013-4a99-a741-fcabd553953e/dietpi_userdata/mini/Mute (2018) was moved here.
          [2018/05/10 13:12:45] monitor.c:151: info: Added watch to /mnt/045abc53-a013-4a99-a741-fcabd553953e/dietpi_userdata/mini/Mute (2018) [7]
          [2018/05/10 13:12:46] monitor.c:398: debug: Adding: /mnt/045abc53-a013-4a99-a741-fcabd553953e/dietpi_userdata/mini/Mute (2018)/Mute (2018).mkv
          [2018/05/10 13:13:35] monitor.c:720: debug: The file /mnt/045abc53-a013-4a99-a741-fcabd553953e/dietpi_userdata/mini/Mute (2018)/Mute (2018).hr.srt was changed.
          [2018/05/10 13:13:35] monitor.c:720: debug: The file /mnt/045abc53-a013-4a99-a741-fcabd553953e/dietpi_userdata/mini/Mute (2018)/Mute (2018).sr.srt was changed.
          

          Edit: I installed minidlna again but without editing anything..so this time i didn't edit metadata.c to add .sr before .srt
          i renamed my .sr.srt files to .srt and tried to moving movies to media_dir without subtitles, and then moved subtitles to these folders, and minidlna registered subtitles every time, even if i add subtitles after 10+ minutes..

          I guess my edit of metadata.c is incomplete and i must edit something else also for .sr.srt to work?
          So again, if i add .sr.srt with movie file at the same time, minidlna will register .sr.srt. But if that .sr.srt file is added after movie file is added, .sr.srt will not be registered.. only after i delete files.db and restart minidlna, that .sr.srt will be registered..
          thanks for help

           

          Last edit: Milos Starcevic 2018-05-10
  • Milos Starcevic

    Milos Starcevic - 2018-05-14

    I ended making script that create soft links from .sr.srt to .srt
    It's working well

     
  • Sérgio M. Basto

    Hi, I also I'd like have this feature , it take me some time undertand that doesn't read foo.pt.srt but read foo.srt ...

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.