Jump to content

Auto Organize without renaming the file


JunkStar

Recommended Posts

JunkStar

Hi

 

I would really like that option to use the auto organizer without it renaming the files since some of the stuff i download comes with custom subtitles and renaming the media file would break that.

 

Would this be possible to implement?

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 4 months later...
oxidius

I'd like that feature too. I love auto-organize, but I can't use it anymore because of loosing the team, resolution, source, etc.

Link to comment
Share on other sites

The resolution is extracted by Emby, that shouldn't be a problem. But the original filename _does_ get lost, that's right.

 

We might be able to add a pattern/token for the original filename to the "Episode file patterns" in the autoorganize configuration.

 

@Luke: What do you think about that?

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...

+1 

 

Been playing around with the code just to learn and this was an easy fix.

 

In Emby.Server.Implementations.FileOrganization you will find the function responsible for naming GetEpisodeFileName and by adding a new pattern I can now use the original file name in my naming pattern like this :  %fn.%ext. 

 

%fn becomes a match for the filename without extension by adding one more Replace to the result.

Of course the settings page would need to be updated to reflect this as well.

 

            var result = pattern.Replace("%sn", seriesName)
                .Replace("%s.n", seriesName.Replace(" ", "."))
                .Replace("%s_n", seriesName.Replace(" ", "_"))
                .Replace("%s", seasonNumber.ToString(_usCulture))
                .Replace("%0s", seasonNumber.ToString("00", _usCulture))
                .Replace("%00s", seasonNumber.ToString("000", _usCulture))
                .Replace("%ext", sourceExtension)
                .Replace("%en", "%#1")
                .Replace("%e.n", "%#2")
                .Replace("%e_n", "%#3")
                .Replace("%fn",Path.GetFileNameWithoutExtension(sourcePath));
Edited by HomerS
Link to comment
Share on other sites

@@Luke (or any other dev)  Could we please get this into the dev branch ?  

 

 Im not into js so not sure how to get it onto the settings page but the it is this file :)

MediaBrowser.WebDashboard\dashboard-ui\dashboard\autoorganizetv.js

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...