Jump to content

Auto Organize - Expanding its functionality


aaronsomek

Recommended Posts

chef

Oh, beta server is throwing an error in the browser.

Interesting...

I can fix it. One moment.

Link to comment
Share on other sites

vaise

Am have been dragged out by the wife to the home show in Brisbane.  Won’t be back for 8 hours or so to do more testing.  Sorry.

Link to comment
Share on other sites

chef
7 minutes ago, vaise said:

Am have been dragged out by the wife to the home show in Brisbane.  Won’t be back for 8 hours or so to do more testing.  Sorry.

Have fun 👋

Link to comment
Share on other sites

chef

So my errors where because we had a database change a while ago, and I didn't do the upgrade.

Once, that happened on my beta server, things loaded okay.

I'll post a new version here, with changes that will hopefully help vaise, and also has some new capabilities as well.

Link to comment
Share on other sites

Happy2Play
1 minute ago, chef said:

So my errors where because we had a database change a while ago, and I didn't do the upgrade.

Once, that happened on my beta server, things loaded okay.

I'll post a new version here, with changes that will hopefully help vaise, and also has some new capabilities as well.

Yep was just going to post beta throws this error.

2022-03-31 15:43:40.527 Error Server: Error processing request
	*** Error Report ***
	Version: 4.7.0.32
	Command line: C:\Users\Media\AppData\Roaming\Emby-Server\system\EmbyServer.dll
	Operating system: Microsoft Windows 10.0.22581
	Framework: .NET 6.0.2
	OS/Process: x64/x64
	Runtime: C:/Users/Media/AppData/Roaming/Emby-Server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: C:\Users\Media\AppData\Roaming\Emby-Server\programdata
	Application path: C:\Users\Media\AppData\Roaming\Emby-Server\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)
	
2022-03-31 15:43:40.527 Debug Server: http/1.1 Response 500 to ::1. Time: 6ms. http://‌‍‍localhost‌:8097/emby/Library/FileOrganization?StartIndex=0&Limit=50&X-Emby-Client=Emby 

 

Link to comment
Share on other sites

chef

Version 1.6.1.2

  • Allow multiple watched folders. This will help while monitoring destination folders from many different television recording application directories . 

many_source_folders.png.10ebeb09709174589cfc5e84723b0128.png

  • The UI will show Season/Episode data under the Release/Edition column for episodes.

release_info.png.1272ed212c8e0891af8c15955a5bad46.png

  • While movies will again show the "Edition" information in the column. (Just a reminder that the edition information for movies can be added to the name of the destination file)

file_naming.png.6a68af9c115e686edaf729b54c26b724.png

            VideoReleaseEditionFlags = new string[]
            {
                "Theatrical",
                "Version",
                "Extended",
                "Special",
                "Edition",
                "Directors",
                "Final" ,
                "Cut",
                "Uncut",
                "Unrated",
                "Ultimate"
            };
  • Reminder that you do now have options to move new recordings into the library, based on strings found in the file name.

 

Edited by chef
Link to comment
Share on other sites

chef
4 minutes ago, Happy2Play said:

Yep was just going to post beta throws this error.

2022-03-31 15:43:40.527 Error Server: Error processing request
	*** Error Report ***
	Version: 4.7.0.32
	Command line: C:\Users\Media\AppData\Roaming\Emby-Server\system\EmbyServer.dll
	Operating system: Microsoft Windows 10.0.22581
	Framework: .NET 6.0.2
	OS/Process: x64/x64
	Runtime: C:/Users/Media/AppData/Roaming/Emby-Server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: C:\Users\Media\AppData\Roaming\Emby-Server\programdata
	Application path: C:\Users\Media\AppData\Roaming\Emby-Server\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)
	
2022-03-31 15:43:40.527 Debug Server: http/1.1 Response 500 to ::1. Time: 6ms. http://‌‍‍localhost‌:8097/emby/Library/FileOrganization?StartIndex=0&Limit=50&X-Emby-Client=Emby 

 

The only way to fix this is to remove the fileorganizer.db in the data folder, and restart the server.

I'm having some problems learning how to update the Sqlite table. It drives me nutz.

After that, all the column names are present. I don't think we need to write new columns to the db ever again. So hopefully that isn't a deal breaker.

  • Like 1
Link to comment
Share on other sites

ttgapers
14 hours ago, chef said:

DOWNLOAD: (install and clear browser cache): Emby.AutoOrganize_v1.6.1.2.rar

Hi @chef

I tried this release but it isn't "saving" any of my folders to be monitored, and therefore moves nothing lol. Tried all above and even removing the old fileorg.db. Rolled back for now. Wondering if resolution can be added for TV episodes also. I have some mixed 720p/4K episodes for some key shows.

Thanks for all your efforts!

 

  • Thanks 1
Link to comment
Share on other sites

chef
4 minutes ago, ttgapers said:

Hi @chef

I tried this release but it isn't "saving" any of my folders to be monitored, and therefore moves nothing lol. Tried all above and even removing the old fileorg.db. Rolled back for now. Wondering if resolution can be added for TV episodes also. I have some mixed 720p/4K episodes for some key shows.

Thanks for all your efforts!

 

Did you clear the browser cache?

Link to comment
Share on other sites

ttgapers
5 minutes ago, chef said:

Did you clear the browser cache?

Yup I run inprivate and clear everything on browser close (which I did). Can retry if you like :)

  • Thanks 1
Link to comment
Share on other sites

chef

Also, does anything error in the browser dev console?  I'm just not seeing any errors.

Thank you for your time. 

Edited by chef
Link to comment
Share on other sites

ttgapers
26 minutes ago, chef said:

Okay, can I see a log please?

Let me put the latest version back and get you what you are looking for :)

@chef - sent

Edited by ttgapers
Link to comment
Share on other sites

chef
47 minutes ago, ttgapers said:

Let me put the latest version back and get you what you are looking for :)

@chef - sent

Thank you. Did you pm me the log?

Link to comment
Share on other sites

chef

Quick update here regarding the plugin.

As @ttgapers has brought to my attention, (currently) movies must have a year in the file name in order to handle sorting.

  1. I'm going to change this, so a year is not absolutely necessary for a movie file to sort.
  2. However, if at all possible, the production year of the movie in the file name would help the logic target the file as a movie much easier. So, if users can have  a year present in the file name, it would be the best, but won't be necessary.
  3. Episodes must have the season, and episode numbers they belong to in the file name, so that the sorting logic  will know what to do with them.

         (If your recording DVR can naming them: MySeries.S01E02.ts, or  MySeries.1x02.ts the sorting method will know where to put them in the library)

 

I'll be back with an update!  Thank so much ttgapers! Awesome work!

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

chef

I've added better logging. So, if a file found in the watched folder doesn't adhere to the file naming expectations the log will have a better descriptive warning.

Sorting media type for {file.Name} is unknown. New episodes must contain the season index number, and episode index number in the file name.

 

I will fix movies next.

Link to comment
Share on other sites

chef

I'm hesitant about this line of code. 

 //The file name didn't have a date in it. It also doesn't have any episode indicators. Treat it as a movie.
 if (testTvShow.Matches(fileName).Count < 1)
 {
     return FileOrganizerType.Movie;
 }

 

This will attempt to sort any file which doesn't have episode indicators (S01E01) as a movie. 😬

This will most certainly fail when the item is an episode with improper file naming. However, it will be mentioned in the log file.

I will also create a Github wiki, and link to it as a help page. That github page will explain the file naming expectations for proper sorting to happen.

I think this is the best that can happen. But, I'm interesting in  any thoughts and feedback regarding file naming.

Be right back with an update.

Link to comment
Share on other sites

ttgapers
1 hour ago, chef said:

Thank so much ttgapers! Awesome work!

no bro @chef, thank you for accepting it and working through it with me so quickly. Much appreciated :)

I will test and let you know how things go. Best regards.

Link to comment
Share on other sites

slevin7

Thanks for your work.
But I have a small problem. if I want to assign a movie or a series, I have to assign once the whole thing again, because otherwise somehow nothing works.
But take a look 😃

 

 

  • Thanks 1
Link to comment
Share on other sites

chef
19 minutes ago, slevin7 said:

Thanks for your work.
But I have a small problem. if I want to assign a movie or a series, I have to assign once the whole thing again, because otherwise somehow nothing works.
But take a look 😃

 

 

Ah! Yup! One minute! We're got an unforseen domino effect happening on items with the new logic.

Sorry! 

I didn't think to check the identification page. 

It will only take a moment to sort out... No pun intended. 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

chef

@slevin7

I was able to create a mock movie test file. This is not an actual movie file, this is just a mock file, and mock name I found on the internet.

 

I am unable to recreate the strange thing happening while identifying the file.

Below are some images from my experience testing :) 

 

The file is found in the source folder, and is unable to be identified.

 example_1.thumb.png.4b1a62a43649b37d16e65a305e67bc60.png

 

I click on the identify button, and the window opens without any strange behavior. It also already know' it is a movie.

example_2.thumb.png.f485551ab8af1731849e9c99dfe3e7ab.png

 

I am able to press the "+" button, and bring up the search window.

example_3.thumb.png.dd0d2bd95b2b67513a7d56e8048aade3.png

 

Pressing the "Search" button then opens the provider window with the movie in question.

example_4.thumb.png.a16c5676e2a3dac7a81e7d62587386d2.png

 

I haven't finished testing yet.  I will find the problem and fix it.

 

 

Did you happen to remember to clear browsing data? and are you using version 1.6.1.3?

 

Link to comment
Share on other sites

slevin7

Yes it is the latest version. Maybe the log helps?
 

*** Error Report ***
Version: 4.7.0.32
Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
Operating system: Linux version 5.4.0-107-generic (buildd@lcy02-amd64-058) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)) #121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2
Framework: .NET 6.0.2
OS/Process: x64/x64
Runtime: opt/emby-server/system/System.Private.CoreLib.dll
Processor count: 4
Data path: /var/lib/emby
Application path: /opt/emby-server/system
System.ArgumentNullException: System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
at System.IO.Path.Combine(String path1, String path2)
at Emby.AutoOrganize.Core.FileOrganization.MovieOrganizer.CreateNewMovie(MovieFileOrganizationRequest request, BaseItem targetFolder, FileOrganizationResult result, AutoOrganizeOptions options, CancellationToken cancellationToken)
at Emby.AutoOrganize.Core.FileOrganization.MovieOrganizer.AutoDetectMovie(String movieName, Nullable`1 movieYear, FileOrganizationResult result, AutoOrganizeOptions options, CancellationToken cancellationToken)
at Emby.AutoOrganize.Core.FileOrganization.MovieOrganizer.OrganizeMovie(Nullable`1 requestToMoveFile, String sourcePath, String movieName, Nullable`1 movieYear, AutoOrganizeOptions options, FileOrganizationResult result, CancellationToken cancellationToken)
at Emby.AutoOrganize.Core.FileOrganization.MovieOrganizer.OrganizeFile(Nullable`1 requestToMoveFile, String path, AutoOrganizeOptions options, CancellationToken cancellationToken)
Source: System.Private.CoreLib
TargetSite: System.String Combine(System.String, System.String)

So after a little back and forth clicking, I can make a movie to

Sorry that I have only now reported, I still needed a TestFile what also interests me 

  • Thanks 1
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...