Win [XBMCSubtitles]How to remove .en. from subtitle filename
#31
It is unfortunate that this was rejected but I just wanted to register my viewpoint:

The industry has standardized on <filename.srt> and just about every player out there supports this. XBMC/Kodi has chosen a [superior] alternate format of <filename.lang.srt> which noone else supports. It really is ludicrous to expect the rest of the industry and all the players to change and support this format. It just isn't going to happen.

Regardless of being more complex or not, every toggle and option within XBMC/Kodi requires additional complexity to support multiple options. This is a choice that breaks subtitle use for every other player. IMO it should have been a no-brainer to add the option for one or the other or both and accept the additional complexity to the code.

In the meantime, a quick cron job script takes care of it for me but it sure does suck to have to create this hack because my preferred media player decided to make a nonstandard subtitle naming choice...

Code:
#!/bin/bash
# This will rename a subtitle.en.srt file to subtitle.srt.  The .en.srt files are downloaded and renamed by XBMC/Kodi but EVERY OTHER PLAYER needs to have just .srt files.
IFS=$(echo -en "\n\b")

for i in $(find . -name "*.en.srt")
do
        DIR=$(dirname $i)
        FILE=$(basename $i)
        NEWFILE=$(echo $FILE|sed -e 's/\.en\.srt/\.srt/')
        mv "$i" "$DIR/$NEWFILE"
done
Reply
#32
I really don't understand why this was rejected. Kodi is a huge software application with lots, really LOTS of complicated settings, some of them very vague.

This setting wouldn't be too hard to implement, and it's function would be very clear for everybody. You might even hide it in the expert settings part, I mean, that's what these levels were made for to begin with.

I sometimes get the feeling that Kodi-developers just look as far as their own needs. "Hey, I don't use Plex, a Mediaplayer, tablet of smart TV to watch my content, so why would I take that in consideration."

Adding this little switch,albeit by adding something in an xml-file would make life much better for all people using these other devices.

Too bad nobody seems to care. Oh well, Frodo still works fine....
Reply
#33
(2014-12-28, 17:35)choekstr Wrote:
Code:
#!/bin/bash
# This will rename a subtitle.en.srt file to subtitle.srt.  The .en.srt files are downloaded and renamed by XBMC/Kodi but EVERY OTHER PLAYER needs to have just .srt files.
IFS=$(echo -en "\n\b")

for i in $(find . -name "*.en.srt")
do
        DIR=$(dirname $i)
        FILE=$(basename $i)
        NEWFILE=$(echo $FILE|sed -e 's/\.en\.srt/\.srt/')
        mv "$i" "$DIR/$NEWFILE"
done

It's so useful! Thanks!
Reply
#34
I am so noob so I got to ask.....how can I use/install that script?
Reply
#35
(2015-02-12, 11:12)wolfgr Wrote: I am so noob so I got to ask.....how can I use/install that script?

It works only in Kodi for linux.
If you have a system like this and you able to open a terminal window let me know
Reply
#36
Nope,I have win8 machine for Kodi,thanx anyway :-(
Reply
#37
There are Windows ports for most UNIX commands:
GnuWin
GNU utilities for Win32
cygwin

Alternately there are ways to do it in batch/cmd which would look something like this:
Code:
@echo off
forfiles /S /M *.en.srt /C "cmd /c ren @file @fname
forfiles /S /M *.en /C "cmd /c ren @file @fname.srt

Just put those 3 lines in a file called something like subtitle.cmd and run it at the top level of your movie folder. You could also put it in a scheduled task or AT job.
Reply
#38
thnx for your tip,it works fine on my win8 pc but the thing is my movie folders are in a nas so when i try to run .cmd at the top level of my movies folder i get error access denied and nothing happens.
Reply
#39
Sounds like a windows permissions thing. Fix your permissions, login as a user that has the correct permissions, run cmd as administrator, sync your accounts between the NAS and your PC so passthrough authentication works, etc.

If *you* can't do it then a script can't do it either. So whatever account you are using doesn't have permissions then you need to fix that first. Sounds like you might have read access and not write access.
Reply

Logout Mark Read Team Forum Stats Members Help
[XBMCSubtitles]How to remove .en. from subtitle filename1