Keeping subtitle language

Feature requests, suggestions, etc. go here.

Keeping subtitle language

Postby lucetuweb.com » Sat Jul 31, 2010 6:43 am

Hi all,

I just discoverer this nice application and I liked a lot, but I miss a feature that is not included in any similar application neither.
But this application has source code available, so I download it and include a little code for this feature, keeping subtitle language, I mean for .srt files ending like this:
TVShow - Season - Episode.Eng.srt
or
TVShow - Season - Episode.Spa.srt
I code this in a few minutes and is not checked properly and I don't know if is coded right way according with the author but I just shared here if someone is interested:
in the function:
Code: Select all
public void RenameAndMissingCheck(SetProgressDelegate prog, ShowItem specific)

look for the line:
Code: Select all
if (renCheck && this.Settings.UsefulExtension(fi.Extension, true)) // == RENAMING CHECK ==

and substitute the whole if for this new one:
Code: Select all
if (renCheck && this.Settings.UsefulExtension(fi.Extension, true)) // == RENAMING CHECK ==
                            {
                                string newname;
                                if (fi.Extension != ".srt")                               
                                    newname = this.Settings.FilenameFriendly(this.Settings.NamingStyle.NameForExt(ep, fi.Extension));                                                                   
                                else
                                {
                                    //! Code for preserving subtitle language
                                    string subtitleLanguage = "";
                                    string filename = fi.Name.Substring(0, fi.Name.Length - fi.Extension.Length);
                                    int indexDot = filename.LastIndexOf(".");
                                    if (indexDot > filename.Length - 5)
                                        subtitleLanguage = filename.Substring(indexDot, filename.Length - indexDot);
                                    newname = this.Settings.FilenameFriendly(this.Settings.NamingStyle.NameForExt(ep, fi.Extension));
                                    newname = newname.Substring(0, newname.Length - fi.Extension.Length) + subtitleLanguage + fi.Extension;                                     
                                }
                                if (newname != actualFile.Name)
                                {
                                    actualFile = Helpers.FileInFolder(folder, newname); // rename updates the filename
                                    this.TheActionList.Add(new ActionCopyMoveRename(ActionCopyMoveRename.Op.Rename, fi, actualFile, ep));
                                }
                            }


I would like to say a BIG THANK YOU to the author of this cool application TVRename. If you do not like this, please feel free to delete it ;-)

Best regards,
Rafa
YourBestCatalog (movie cataloger application)
lucetuweb.com
 
Posts: 2
Joined: Sat Jul 31, 2010 6:29 am

Re: Keeping subtitle language

Postby major4579 » Wed Aug 04, 2010 7:06 am

Rafa,

That sounds exactly like what I want - is there some way to get a copy of the patched file from you?

John
major4579
 
Posts: 4
Joined: Fri Apr 16, 2010 1:49 am

Re: Keeping subtitle language

Postby lucetuweb.com » Wed Aug 04, 2010 8:22 pm

Hello John,

I respect a lot the owner of the application, I am a programmer too. So if him let me send the application modified to you I will do it.
I will wait until him say his opinion.

have a nice day!
YourBestCatalog (movie cataloger application)
lucetuweb.com
 
Posts: 2
Joined: Sat Jul 31, 2010 6:29 am

Re: Keeping subtitle language

Postby zappza » Tue Sep 07, 2010 3:12 am

Totally agree on this feature.

If possible, the languages should be configurable. As far as I understand, the "standard" for subtitle languages is *filename*.*lan*.*ext* where lan is a two character language code i.e. EN (English), NO (Norwegian), DK (Danish). However, I like to format the languages in their full name. Ex. *filename*.Norwegian.*ext* instead of *filename*.NO.*ext* purely for cosmetic reasons.
zappza
 
Posts: 1
Joined: Tue Sep 07, 2010 3:07 am


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest