Jump to content

Auto Organize - Expanding its functionality


aaronsomek

Recommended Posts

  • 4 weeks later...
TheUrbanXplorer

Hello @chef,
unfortunately I could not hear from me for quite a while. Privately, it was here under and over.
The current state of the plugin is that series are recognized in the correct language, but are no longer moved and named.
Movies are now moved and named, but no longer in the correct language.
Somehow there is the worm in it.

What do you need?

Greetings from Wuppertal, Germany!

  • Agree 1
Link to comment
Share on other sites

chef
6 hours ago, norbo80 said:

hello,

amazing work. There is any possibility to add more the one monitor folder? @chef

Thank you.

Hi! I believe we can currently monitor one folder for movies and one for tv shows.

We could monitor more then one folder for each type. 

Would you mind explaining what the use case might be, to have more then one monitor folder for each type? 👍

Link to comment
Share on other sites

neik

chef, with the latest server update I did (went from .18 beta to .30 beta) the organize and delete button turned black.

image.png.57734554a3acf0baf967e51b8758ca76.png

As I am usually using the black theme I can't see them (black on black), the screenshot was made with blue radiance theme.
Anything you can do about  that, maybe the button color needs to be theme dependend?

Thank you!

  • Thanks 1
Link to comment
Share on other sites

norbo80
On 19/03/2022 at 18:19, chef said:

Hi! I believe we can currently monitor one folder for movies and one for tv shows.

We could monitor more then one folder for each type. 

Would you mind explaining what the use case might be, to have more then one monitor folder for each type? 👍

Currently I got following configuration:

Sonarr download Path - /downloads/complete/series

Radarr download Path - /downloads/complete/movies

Transmission - which monitoring /torrents folder. 

Chrome - Add on - Download Router.

and now:

Radarr, Sonarr - here is all ok, working very well 

but, sometimes i searching on Torrent portals directly, then if I will download the torrent file:

1. Chrome - Add on - Download Router - redirect torrent file to /torrent folder

2. Transmission pull the torrent file form /torrent folder

3. Transmission downloading File to  /downloads/complete folder (default transmission folder) because it not receiving download path info from Radarr/Sonarr

 

Therefore it will be great have a possibility to monitor two folders for series:

/downloads/complete/series

/downloads/complete

and two for movies:

/downloads/complete/movies

/downloads/complete/

 

Thank you!

and two for movies:

 

Link to comment
Share on other sites

chef

1. Season naming above 9

2. Movie sorting gets stuck while checking to see if a version already exists in the library.

3. Fix blacked out icons in the table when I. A dark mode style

4. Series are not sorting.

5. Movies are being sorted in a wrong language.

 

Theses are the top issues to tackle.

 

 

Edited by chef
Link to comment
Share on other sites

vaise

@chef, anything you want me to test re this Season naming above 9, I am happy to help.

I added the latest dll you posted in this thread.....

Edited by vaise
  • Thanks 1
Link to comment
Share on other sites

chef

I have a question for you guys.

Currently I have setup one monitored folder for both tv shows and movies.

The plugin is capable of monitoring this one folder and sorting each type.

Is there any reason why we couldn't just have one monitored folder?

We would still have the configuration options for each type, but everything would be placed in one monitored folder.

This would shorten the code substantially, making it easier to maintain.

It would also allow us to shorten the configuration down to one page for sorting.

How bad is it to place all new media items into one folder, and allow the plugin to do it's thing?

  • Like 2
Link to comment
Share on other sites

neik
17 minutes ago, chef said:

Currently I have setup one monitored folder for both tv shows and movies.

Same here and it has been working quite good so far.

Link to comment
Share on other sites

GiGo
1 hour ago, chef said:

Is there any reason why we couldn't just have one monitored folder?

This sounds like a great idea! However Auto Recognition of films wouldn't work, which I am not bothered about personally.

I folder would make much more sense to me!

Link to comment
Share on other sites

chef
59 minutes ago, GiGo said:

This sounds like a great idea! However Auto Recognition of films wouldn't work, which I am not bothered about personally.

I folder would make much more sense to me!

I think I can get auto recognition working movies using one folder. 

 

2 hours ago, neik said:

Same here and it has been working quite good so far.

 

 

I think we should try this.

We could always go back if there are problems But I can't really foresee why we couldn't do this.

It would be much easier to manitain.

Right now the entire movie sorting is almost exactly the same code copied and pasted. The core sorting would stay the same, we would just look in one place for the items instead of two.

 

Let me try and code this up. I won't update the GitHub incase it runs off the rails.

 

I'll be back, it might take me a while, but know I'm on it!

 

  • Like 3
Link to comment
Share on other sites

chef

Consolidating the plugin came together quicker then I thought.

I'll have to test it to make sure it all works, but so far I have sorted a movie and a tv show using the new one folder method and everything is working like before.

There is now one config page for settings.

Before there was two objects that got called inside the main configuration object.

It was confusing AF.

Just have to layout the settings page to be usable.

I believe this is going to fix the movie and tv sorting issues we had.

 

I also made sure to fix the sorting buttons on the activity table. So they will be theme specific.

 

Now, I'll find the problems with languages and provider data.

That might take some time.

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

8 hours ago, chef said:

Is there any reason why we couldn't just have one monitored folder?

What happens when you have different pipelines that you process?
Or use a few download type programs?  Do you really want these all dumping files to the same output location?

I'm just asking and haven't tried this but would think multiple inputs would be better, just like in Library setup you can have multiple mount points.
Although I guess if you're done everything your going to do to the files and ready to have it added to Emby it doesn't matter.

So after just answering my own question, I guess the only thing I'd have left is that I would think being able to specify one path for shows and one path for movies would be best simply because anything in movies should never get mis-classified as a show and vice versa.    Without the different paths how do you make sure that doesn't happen?

  • Like 1
Link to comment
Share on other sites

chef
19 minutes ago, cayars said:

What happens when you have different pipelines that you process?
Or use a few download type programs?  Do you really want these all dumping files to the same output location?

I'm just asking and haven't tried this but would think multiple inputs would be better, just like in Library setup you can have multiple mount points.
Although I guess if you're done everything your going to do to the files and ready to have it added to Emby it doesn't matter.

So after just answering my own question, I guess the only thing I'd have left is that I would think being able to specify one path for shows and one path for movies would be best simply because anything in movies should never get mis-classified as a show and vice versa.    Without the different paths how do you make sure that doesn't happen?

In that case, we can have multiple folders (it was a request to have that ability a few posts back).

But, I still think we can organize both media types from one folder, and again both types from multiple folders.

This way you could only have one type of media in it... But the plugin wouldn't count on it.

I'll run some auto tests and get back to you.

The regex is pretty good at figuring out movies from tv shows in the naming.

 

Link to comment
Share on other sites

vaise

@chef - don't forget my post about the naming of the episodes to remove the preceding 0 if seasons >9 (or have an option for it)

Personally, sonarr/radarr takes tare of most shows/movies for me.  It is the manual ones I use auto-organise for.  I don't use it for movies, so the one/two monitoring folder locations are irrelevant for me.

Link to comment
Share on other sites

chef
16 minutes ago, vaise said:

@chef - don't forget my post about the naming of the episodes to remove the preceding 0 if seasons >9 (or have an option for it)

Personally, sonarr/radarr takes tare of most shows/movies for me.  It is the manual ones I use auto-organise for.  I don't use it for movies, so the one/two monitoring folder locations are irrelevant for me.

Yep! I'm actually about to work on it right now. 

I've just gotta mock up some series with 10 seasons to try and sort.

Then I'll smack out an update like Will Smith Smacked Chris Rock and the Oscars... 😳..  too soon? 😆

  • Haha 1
Link to comment
Share on other sites

vaise

Ha! 

I just had the need to use this new and improved plugin, I got three TV shows sitting in my watch folder -  /mnt/user/Downloads/Completed/EmbyAutoOrganise.

When I hit the plugin, I just get a spinning circle.  Tried another browser, thinking it may be cache.

I click the schedule circle and it does change the date of task last run, just never shows anything completed.

I know I am late to this new plugin version, so any instrujctions that I hay have missed ?

Checked log and I have this - sql database issue ? :

2022-03-29 12:47:53.941 Error Server: Error processing request
    *** Error Report ***
    Version: 4.7.0.32
    Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
    Operating system: Linux version 5.10.28-Unraid (root@Develop) (gcc (GCC) 9.3.0, GNU ld version 2.33.1-slack15) #1 SMP Wed Apr 7 08:23:18 PDT 2021
    Framework: .NET 6.0.2
    OS/Process: x64/x64
    Runtime: system/System.Private.CoreLib.dll
    Processor count: 6
    Data path: /config
    Application path: /system
    SQLitePCL.pretty.SQLiteException: Error: no such column: ExtractedResolution - SELECT ResultId, OriginalPath, TargetPath, FileLength, OrganizationDate, Status, OrganizationType, StatusMessage, ExtractedName, ExtractedYear, ExtractedSeasonNumber, ExtractedEpisodeNumber, ExtractedEndingEpisodeNumber, ExtractedResolution, ExtractedEdition, ExternalSubtitlePaths, DuplicatePaths from FileOrganizerResults ORDER BY OrganizationDate desc LIMIT 50
    SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.
       at SQLitePCL.pretty.SQLiteDatabaseConnection.PrepareStatement(String sql, String& tail)
       at SQLitePCL.pretty.DatabaseConnection.PrepareStatement(IDatabaseConnection This, String sql)
       at Emby.AutoOrganize.Data.SqliteFileOrganizationRepository.GetResults(FileOrganizationResultQuery query)
       at Emby.AutoOrganize.Core.InternalFileOrganizationService.GetResults(FileOrganizationResultQuery query)
       at Emby.AutoOrganize.Api.FileOrganizationService.Get(GetFileOrganizationActivity request)
       at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost appHost, Object requestDto, IRequest req)
       at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
       at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
    Source: SQLitePCL.pretty
    TargetSite: SQLitePCL.pretty.IStatement PrepareStatement(System.String, System.String ByRef)

 

Link to comment
Share on other sites

chef
4 minutes ago, vaise said:

Ha! 

I just had the need to use this new and improved plugin, I got three TV shows sitting in my watch folder -  /mnt/user/Downloads/Completed/EmbyAutoOrganise.

When I hit the plugin, I just get a spinning circle.  Tried another browser, thinking it may be cache.

I click the schedule circle and it does change the date of task last run, just never shows anything completed.

I know I am late to this new plugin version, so any instrujctions that I hay have missed ?

Checked log and I have this - sql database issue ? :

2022-03-29 12:47:53.941 Error Server: Error processing request
    *** Error Report ***
    Version: 4.7.0.32
    Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
    Operating system: Linux version 5.10.28-Unraid (root@Develop) (gcc (GCC) 9.3.0, GNU ld version 2.33.1-slack15) #1 SMP Wed Apr 7 08:23:18 PDT 2021
    Framework: .NET 6.0.2
    OS/Process: x64/x64
    Runtime: system/System.Private.CoreLib.dll
    Processor count: 6
    Data path: /config
    Application path: /system
    SQLitePCL.pretty.SQLiteException: Error: no such column: ExtractedResolution - SELECT ResultId, OriginalPath, TargetPath, FileLength, OrganizationDate, Status, OrganizationType, StatusMessage, ExtractedName, ExtractedYear, ExtractedSeasonNumber, ExtractedEpisodeNumber, ExtractedEndingEpisodeNumber, ExtractedResolution, ExtractedEdition, ExternalSubtitlePaths, DuplicatePaths from FileOrganizerResults ORDER BY OrganizationDate desc LIMIT 50
    SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.
       at SQLitePCL.pretty.SQLiteDatabaseConnection.PrepareStatement(String sql, String& tail)
       at SQLitePCL.pretty.DatabaseConnection.PrepareStatement(IDatabaseConnection This, String sql)
       at Emby.AutoOrganize.Data.SqliteFileOrganizationRepository.GetResults(FileOrganizationResultQuery query)
       at Emby.AutoOrganize.Core.InternalFileOrganizationService.GetResults(FileOrganizationResultQuery query)
       at Emby.AutoOrganize.Api.FileOrganizationService.Get(GetFileOrganizationActivity request)
       at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost appHost, Object requestDto, IRequest req)
       at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
       at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
    Source: SQLitePCL.pretty
    TargetSite: SQLitePCL.pretty.IStatement PrepareStatement(System.String, System.String ByRef)

 

Delete the "fileorganizer.db" file in Emby's data folder.

Sorry, we changed the database for the plugin.

Let me know if you need some more info finding that file.

Once the database is deleted, restart the server.

 

Link to comment
Share on other sites

vaise
5 minutes ago, chef said:

Delete the "fileorganizer.db" file in Emby's data folder.

Sorry, we changed the database for the plugin.

Let me know if you need some more info finding that file.

Once the database is deleted, restart the server.

 

Ah - that works much better now.  Thanks.

Link to comment
Share on other sites

chef
5 minutes ago, vaise said:

Ah - that works much better now.  Thanks.

Does that version happen to fix the issue with season over 9 having naming issues?

I thought I fixed it, but to be honest, I can't remember.

Either way, I'm working on it. 

Link to comment
Share on other sites

vaise

I have another issues that has always been there - and I manually manage - May as well raise it now while i am on a roll!!!!!!!

For example, I have Dynasties in two locations - :

/mnt/user/Media4K/Media-TVShows4K/Dynasties/

/mnt/user/Media-TVShows/Dynasties/

There are two libraries to match the above.

I just added two episodes of Dynasties, and it wrote to the 4k set :

image.thumb.png.f5cc5a1ad4f979f18e20e70819e411f6.png

Firther to this, I have another thig that is the same issue I believe, but different folders.  That relates to Gogglebox.  Gogglebox is on TV here is Australia and I record it - so it is in /mnt/user/EmbyRecordingsSSD, but there is also a gogglebox UK in emby that has the metadata name of 'Gogglebox'.  When that UK edition gets added via auto organise, it instead writes it to the EmbuRecordingsSSD location, imnstead of following what is actually set in the   Default Series Library folder

image.png.5ab53215be7144d9f930466ee3782aed.png

In summary - the default series libarry folder is NOT being forced (as can be seen with the image above and dynasties).

  • Like 1
Link to comment
Share on other sites

chef
36 minutes ago, vaise said:

I have another issues that has always been there - and I manually manage - May as well raise it now while i am on a roll!!!!!!!

For example, I have Dynasties in two locations - :

/mnt/user/Media4K/Media-TVShows4K/Dynasties/

/mnt/user/Media-TVShows/Dynasties/

There are two libraries to match the above.

I just added two episodes of Dynasties, and it wrote to the 4k set :

image.thumb.png.f5cc5a1ad4f979f18e20e70819e411f6.png

Firther to this, I have another thig that is the same issue I believe, but different folders.  That relates to Gogglebox.  Gogglebox is on TV here is Australia and I record it - so it is in /mnt/user/EmbyRecordingsSSD, but there is also a gogglebox UK in emby that has the metadata name of 'Gogglebox'.  When that UK edition gets added via auto organise, it instead writes it to the EmbuRecordingsSSD location, imnstead of following what is actually set in the   Default Series Library folder

image.png.5ab53215be7144d9f930466ee3782aed.png

In summary - the default series libarry folder is NOT being forced (as can be seen with the image above and dynasties).

 

Strange that it writes Googlebox there, but I think I know why it would.

We check to see if  the item in the monitored folder belongs to a library item before attempting to create a new series,  if needs be.

It obviously sees the recordings folder as a library folder, and decides to place it in there.

We're going to have to try and isolate the folders where we check for existing series.

 

 

 

The dynasty issue is a common one I've seen a lot of. 

There was a request to handle destination folders based on file resolution (720p, 1080p, 4K, etc).

There is one problem though. 

Some files found on the internet don't use "4K" in the naming. They use the resolution of "2160p". 

Sorting  files based on resolution get a bit tricky.

We'd have to make the connection between "4K" being equal to "2160p", and setting up the plugin configuration might get advanced.

 

I was able to add the resolution into the naming.

For example:

-- Movies
---- Ghostbusters (1984)
-------- Ghostbusters (1984) - 1080p.mkv" 
-------- Ghostbusters (1984) - 2160p.mkv" 

 

Turns out having the resolution options in the UI

autoporganize_resoluition_example.thumb.png.b2f89a7e2caeb288cf0a048111256e1f.png

 

Have to think about the best way to handle resolution folder sorting.

 

 

-------------------------------------------------------------------------------------------------------------

In the meantime, the new code I added which handles deciding a movie from a TV series is working perfectly!

the code  was able to mark the new item in the monitored folder as a movie, and utilize the proper sorter to handle it. 

 

autoporganize_type_example.thumb.png.2346ba6b8a39f838a2444520ec9bf6cf.png

 

 

 

Edited by chef
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...