Jump to content

Auto Organize - Expanding its functionality


aaronsomek

Recommended Posts

TheUrbanXplorer
2 hours ago, chef said:

I have been going over how to best handle these subtitles. 

 I was able to add a list of found subtitles to the organization result.

But, there is one big problem. Sometimes subtitle files are zipped up in a .rar/.zip files, and they also go 2 compressed files deep.

examplesubtitle.thumb.png.20287b58ef7b3a0a6a8f6a8c328f8706.png

That is a ordeal.

It means that we have to extract them, make the connection between the extracted file, and the movie result, keep track of these file so we can successfully copy them, and then remove the extracted files in a file system clean up.

It isn't impossible. But then I started thinking about emby's built in ability to download subtitles, and I started to wonder how important it is to organize these files.

Most of my .mkv files also have subtitles inside the file.

So, what should I do? Should I continue to work on this?

Hello @chef,
I would argue that it is enough if he takes the subtitles that are accessible. That all files should be unpacked should be normal for everyone to understand. At least I think so.
In any case, that would be perfectly enough for me.
Important to me is just still the versioning as. eg "Extended Cut" or "Directors Cut" with the possibility of manual intervention.
An example, what I mean, I had posted once.
What has changed in the update? Habs aufgespielt, but acts as always (admitted, nothing tested yet).

Greetings from Wuppertal

  • Agree 1
Link to comment
Share on other sites

TheUrbanXplorer

Addendum: Of course it wouldn't be bad if Emby could pull subtitles from RAR files as well, but is that possible? No idea...
But the versioning, that's for sure! 🤣

Link to comment
Share on other sites

Personally I'd would not even look into zip files. Auto-Organize should only look for valid subtitle extensions... (.srt etc.)

If that is developed I am a happy camper :)

  • Agree 3
Link to comment
Share on other sites

Overwrite doesn't remove previous files if the extension is different.

I just organised a few episodes that were replacing existing episodes. (I hade some 1080p rips to replace some older 720p ones).

I noticed that if the file extension is different, then the previous file is not removed. 

e.g. I had a 6 episode season - two episodes were mkv files and the other four were mp4 files. All the new ones were mkv. After running the organise task, the two mkvs were replaced but the four mp4s were still there along with the new mkvs.

 

  • Thanks 1
Link to comment
Share on other sites

Also, whilst talking about overwrite - I don't normally like to have the overwrite flag turned on, just in case I get some episodes that are numbered incorrectly.

It would be nice if organise would force overwrite files (regardless of the overwrite setting) if the filename includes the tag "PROPER" or "REPACK".

Link to comment
Share on other sites

1 hour ago, AdrianW said:

Overwrite doesn't remove previous files if the extension is different.

I just organised a few episodes that were replacing existing episodes. (I hade some 1080p rips to replace some older 720p ones).

I noticed that if the file extension is different, then the previous file is not removed. 

e.g. I had a 6 episode season - two episodes were mkv files and the other four were mp4 files. All the new ones were mkv. After running the organise task, the two mkvs were replaced but the four mp4s were still there along with the new mkvs.

 

Thank you for reporting this.

 

I can see exactly where the problem is happening.

I'll get that fixed up today.

 

  • Like 1
Link to comment
Share on other sites

4 hours ago, AdrianW said:

Also, whilst talking about overwrite - I don't normally like to have the overwrite flag turned on, just in case I get some episodes that are numbered incorrectly.

It would be nice if organise would force overwrite files (regardless of the overwrite setting) if the filename includes the tag "PROPER" or "REPACK".

I'm not sure if we should do that, only because it takes some liberties when moving files in the file system... 

What I can do is work on the white list (somehow) so when those strings are found in new source files, they will automatically move to the library.

But that toggle would have to be on

I just can't have the plugin do that automatically, without the user having controlled it in some way.

 

 

Edited by chef
Link to comment
Share on other sites

3 minutes ago, chef said:

I just can't have the plugin do that automatically, without the user having controlled it in some way.

MetaBrowser had a similar feature - there was a field in the options (default = blank) where a user could enter a list of strings (like "PROPER" and "REPACK") that would allow overwriting of existing files.

Link to comment
Share on other sites

I found the relevant MetaBrowser options:
 

      <OverwiteExistingEpisodes>False</OverwiteExistingEpisodes>
      <OverwriteOnResolution>True</OverwriteOnResolution>
      <OverwriteOnWords>True</OverwriteOnWords>
      <OverwriteWords>PROPER;REPACK</OverwriteWords>

 

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, AdrianW said:

MetaBrowser had a similar feature - there was a field in the options (default = blank) where a user could enter a list of strings (like "PROPER" and "REPACK") that would allow overwriting of existing files.

Okay. I can add this. 

 

  • Like 1
Link to comment
Share on other sites

This version here is untested.

I'm currently running it, but the outcomes are still a bit unknown. There is quite a bit happening in this plugin.

If the item is found in your library, and you have 'Overwrite existing items' turned on for movies, we'll remove the item from the library file system, and copy/move over the new version.

That seems the correct course of action.

STILL UNTESTED: Emby.AutoOrganize.zip

 

If you have 'automatically sort movies', and 'overwrite existing items' turn on, then it's going to do exactly that... I don't do that, and to be honest I have never really trusted both those options being turned on.

I know a lot of users like this functionality, but if it were completely up to me I'd remove auto sorting for movies, especially now that the library file is being removed.  But, that's why we have those toggles there I guess.

Once I run this and if it all seems okay, I'll let everyone know.

Edited by chef
Link to comment
Share on other sites

Also, If you are a person who keeps multiple versions of movies. Perhaps because they are different resolutions, then I would seriously consider having those resolutions in the result file filename when sorting. 

 

Link to comment
Share on other sites

I've never managed to get it to auto-sort movies, and I always prefer to do movies manually anyway (I have a few different movie libraries so it really needs to be manual for me).

I'm a bit scared with the overwrite option for TV episodes as well, so I generally have that option set off. But, IMO, only triggering an overwrite when certain words exist in the file name seems like a good solution.

 

Edited by AdrianW
Link to comment
Share on other sites

So far, I haven't come across anything breaking.

I just don't have any .mp4 files to test it against. 

But, when moving existing files (of the same extension) things seem to be still okay.

Now I'll check out the whitelist.

  • Like 1
Link to comment
Share on other sites

Yeah the following file moved without issue with the new code.

Although they both had the same extension, I'm confident in the code to copy over existing files with different extensions (when the 'Organize' button is pressed in the activity log) is working.

autoorganize_2.thumb.png.f4db1e99b086f43e9e231e18dbb5c2f8.png

autoorganize.thumb.png.0de6810c4413837756eea8da53c370e7.png

Edited by chef
Link to comment
Share on other sites

TheUrbanXplorer

Hello @chef,
is there anything new about subtitles and the versions (Special Edition and co.)?
Would be cool if there was something. And I know I'm annoying and you have other things to do.
I'm just curious to see what happens next. 🙂

  • Agree 1
Link to comment
Share on other sites

Can you guys help me figure out some of the Flags for movie versions?

I have this so far, but I might be missing some. :)

            VideoVersionFlags = new string[]
            {
                "Directors Cut",
                "Final Cut",
                "Theatrical Version",
                "Special Edition",
                "Extended Edition",
                "Uncut",
                "Unrated"
            };

Also, how do they look in the file naming?

I know they go inside "[ ]", but are there spaces in the names?

Example: "[DirectorsCut]" or "[Directors Cut]" ?

Edited by chef
  • Like 1
Link to comment
Share on other sites

TheUrbanXplorer
1 hour ago, chef said:

Can you guys help me figure out some of the Flags for movie versions?

I have this so far, but I might be missing some. :)

            VideoVersionFlags = new string[]
            {
                "Directors Cut",
                "Final Cut",
                "Theatrical Version",
                "Special Edition",
                "Extended Edition",
                "Uncut",
                "Unrated"
            };

Also, how do they look in the file naming?

I know they go inside "[ ]", but are there spaces in the names?

Example: "[DirectorsCut]" or "[Directors Cut]" ?

Hello @chef,
I would say the standards are there. I know the "Theatrical Version" as "Theatrical Cut".
Should be with spaces in any case.
Thus [Directors Cut].
The question is how to add special names individually. We have here versions in individual cases with e.g. "Extra Large", "Ultimate Cut" or "Ultimate Hunter Edition".
Otherwise, I think it looks pretty good.

Link to comment
Share on other sites

I think the best thing is to leave the brackets (ex. '[' and ']') up to the user to add in the naming scheme. But I can add the regex to locate the version.

That way the naming scheme would look like:

"[%ver]"

This would out the version inside the brackets.

Or you could leave them out etc.

 

 

 

 

Edited by chef
  • Like 1
Link to comment
Share on other sites

TheUrbanXplorer
15 hours ago, chef said:

I think the best thing is to leave the brackets (ex. '[' and ']') up to the user to add in the naming scheme. But I can add the regex to locate the version.

That way the naming scheme would look like:

"[%ver]"

This would out the version inside the brackets.

Or you could leave them out etc.

 

 

 

 

I think that's a good idea. Maybe the possibility to add the flags can be implemented somehow. Then also the problem with special versions would be solved, which are not yet considered in the list, since the version is used by the name only with a certain film.

Link to comment
Share on other sites

6 hours ago, TheUrbanXplorer said:

I think that's a good idea. Maybe the possibility to add the flags can be implemented somehow. Then also the problem with special versions would be solved, which are not yet considered in the list, since the version is used by the name only with a certain film.

When a file is acquired, what exactly is written in the file name?

Is it "Directors.Cut" or "DirectorsCut"?

Is it "Special.Edition" or "SpecialEdition"?

 

Do I have to prepare the code to encounter all of these possibilities?

Link to comment
Share on other sites

Okay never mind, I have written the code to expect anything regarding Release Versions.

I just have to code the UI, and we can test it out.

Link to comment
Share on other sites

@TheUrbanXplorer

With regards to naming, there are a couple things we'll need to figure out.

Here is our current list of possible "Release Version" naming options:

            VideoReleaseVersionFlags = new string[]
            {
                "Directors Cut",
                "Final Cut",
                "Theatrical Version",
                "Special Edition",
                "Extended Edition",
                "Uncut",
                "Unrated"
            };

 

If I have a name like this:

MyMovie.2021.UNRATED.Directors.Cut.1080p.mkv

 

Then we have 2 release version naming options, both "Unrated", and "Directors Cut".

 

It is  a bit difficult to add both options in the name. For example, if the RegEx is this:

%mn (%my) - [%rv] %res.%ext

 

then my naming will turn out to be:

MyMovie (2021) - [Unrated] 1080p.mkv

 

This is because our expression is using "[%rv]" which will return the first instance of a release version in the name.

 

I haven't yet figured out how to have multiple release version options in the name.

 

Unless "Unrated", and "Uncut" are somehow under a different naming option?

Perhaps a separate list specifically for items which are "Uncut", or "Unrated"? 

We could use the "%u" expression.

%mn (%my) - [%u] [%rv] %res.%ext

would be:

MyMovie (2021) - [Unrated] [Directors Cut] 1080p.mkv

 

Let me know if you have any ideas :)

 

Link to comment
Share on other sites

There are a couple new features I have been working on. Things can get a bit complicated.

I've worked on the Edition naming when sorting files, and I have also worked on the sorting and labeling of source files when they have certain words in the name like "REPACK" or "PROPER".

what is interesting is that these two new features actually can complicate each other, while re-sorting specific editions when they have "REPACK" and "PROPER" in their names.

😆

It can get pretty indepth, so it might take some testing and work to get it all right.

 

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...