Auto-organize plugin for Emby Server
mediabrowser / emby.autoorganize Goto Github PK
View Code? Open in Web Editor NEWAuto-organize plugin for Emby Server
License: MIT License
Auto-organize plugin for Emby Server
License: MIT License
Apparently AutoOrganize plugin does not work at all on Synology because it tries to access to system protected files.
The application should never look inside @eaDir
folders which are used the by the operating system to store extra data.
I mention that the embysrv user already have RW access to these mounts.
Command line: /var/packages/EmbyServer/target/server/EmbyServer.exe -package synology -programdata /var/packages/EmbyServer/target/var -ffmpeg /var/packages/EmbyServer/target/ffmpeg/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/ffmpeg/bin/ffprobe -ffdetect /var/packages/EmbyServer/target/ffmpeg/bin/ffdetect -restartexitcode 121
Operating system: Unix 3.10.105.0
64-Bit OS: True
64-Bit Process: True
User Interactive: False
Mono: 5.18.0.240 (tarball Thu Jan 17 22:30:05 UTC 2019)
Processor count: 4
Program data path: /var/packages/EmbyServer/target/var
Application directory: /volume1/@appstore/EmbyServer/releases/4.0.3.0
System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/volume2/download/@eaDir/[email protected]' is denied.
at System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) [0x00129] in <06b73b509b314fc8a9db8d5f73b3c223>:0
at System.IO.FileSystemEnumerableIterator`1[TSource].HandleError (System.Int32 hr, System.String path) [0x00006] in <06b73b509b314fc8a9db8d5f73b3c223>:0
at System.IO.FileSystemEnumerableIterator`1[TSource].AddSearchableDirsToStack (System.IO.Directory+SearchData localSearchData) [0x00053] in <06b73b509b314fc8a9db8d5f73b3c223>:0
at System.IO.FileSystemEnumerableIterator`1[TSource].MoveNext () [0x0008e] in <06b73b509b314fc8a9db8d5f73b3c223>:0
at System.IO.DirectoryInfo+<CreateEnumerateFilesIterator>d__43.MoveNext () [0x0007a] in <06b73b509b314fc8a9db8d5f73b3c223>:0
at System.Linq.Enumerable+SelectEnumerableIterator`2[TSource,TResult].ToList () [0x0002d] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at Emby.AutoOrganize.Core.TvFolderOrganizer.GetFilesToOrganize (System.String path) [0x0000d] in <ee96e3093afc4d1b9e34cdf35e55094e>:0
at System.Linq.Enumerable+SelectManySingleSelectorIterator`2[TSource,TResult].ToArray () [0x00028] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at System.Linq.Buffer`1[TElement]..ctor (System.Collections.Generic.IEnumerable`1[T] source) [0x0000a] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at System.Linq.OrderedEnumerable`1+<GetEnumerator>d__3[TElement].MoveNext () [0x0001e] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].ToList () [0x00030] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at Emby.AutoOrganize.Core.TvFolderOrganizer.Organize (Emby.AutoOrganize.Model.TvFileOrganizationOptions options, System.Threading.CancellationToken cancellationToken, System.IProgress`1[T] progress) [0x000f6] in <ee96e3093afc4d1b9e34cdf35e55094e>:0
at Emby.AutoOrganize.Core.OrganizerScheduledTask.Execute (System.Threading.CancellationToken cancellationToken, System.IProgress`1[T] progress) [0x00109] in <ee96e3093afc4d1b9e34cdf35e55094e>:0
at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal (MediaBrowser.Model.Tasks.TaskOptions options) [0x00156] in <3d2456253cbd47f6ad5ba9987b1fa974>:0
Source: mscorlib
TargetSite: Void Throw()
at System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) [0x00129] in <06b73b509b314fc8a9db8d5f73b3c223>:0
at System.IO.FileSystemEnumerableIterator`1[TSource].HandleError (System.Int32 hr, System.String path) [0x00006] in <06b73b509b314fc8a9db8d5f73b3c223>:0
at System.IO.FileSystemEnumerableIterator`1[TSource].AddSearchableDirsToStack (System.IO.Directory+SearchData localSearchData) [0x00053] in <06b73b509b314fc8a9db8d5f73b3c223>:0
at System.IO.FileSystemEnumerableIterator`1[TSource].MoveNext () [0x0008e] in <06b73b509b314fc8a9db8d5f73b3c223>:0
at System.IO.DirectoryInfo+<CreateEnumerateFilesIterator>d__43.MoveNext () [0x0007a] in <06b73b509b314fc8a9db8d5f73b3c223>:0
at System.Linq.Enumerable+SelectEnumerableIterator`2[TSource,TResult].ToList () [0x0002d] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at Emby.AutoOrganize.Core.TvFolderOrganizer.GetFilesToOrganize (System.String path) [0x0000d] in <ee96e3093afc4d1b9e34cdf35e55094e>:0
at System.Linq.Enumerable+SelectManySingleSelectorIterator`2[TSource,TResult].ToArray () [0x00028] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at System.Linq.Buffer`1[TElement]..ctor (System.Collections.Generic.IEnumerable`1[T] source) [0x0000a] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at System.Linq.OrderedEnumerable`1+<GetEnumerator>d__3[TElement].MoveNext () [0x0001e] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].ToList () [0x00030] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <badee9b5b53f4a3c92ce72164f2a8645>:0
at Emby.AutoOrganize.Core.TvFolderOrganizer.Organize (Emby.AutoOrganize.Model.TvFileOrganizationOptions options, System.Threading.CancellationToken cancellationToken, System.IProgress`1[T] progress) [0x000f6] in <ee96e3093afc4d1b9e34cdf35e55094e>:0
at Emby.AutoOrganize.Core.OrganizerScheduledTask.Execute (System.Threading.CancellationToken cancellationToken, System.IProgress`1[T] progress) [0x00109] in <ee96e3093afc4d1b9e34cdf35e55094e>:0
at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal (MediaBrowser.Model.Tasks.TaskOptions options) [0x00156] in <3d2456253cbd47f6ad5ba9987b1fa974>:0
2019-03-24 16:13:51.681 Info TaskManager: Organize new media files Failed after 0 minute(s) and 0 seconds
2019-03-24 16:13:51.683 Info TaskManager: ExecuteQueuedTasks
Filename stephen.colbert.2020.04.15.stephen.colbert.from.home.1080p.web.x264-xlf.mkv
is incorrectly detected and renamed as S5E116 (trakt.tv episode page), rather than S5E115 (trakt.tv episode page).
In mixed folder, the detected movie name in library is wrong
This validation should still take place, but only at the point of attempting to create a new series. It should not prevent the user from selecting an existing series using the drop down.
Is it possible to mention a folder to ignore it from the search and auto-organize! I'm not sure if it's a good practice by using the main directory (same one folder) as a "watch folder" for both TV and movies, but there is another library inside the same folder that I don't want to include and keep it as it.
default selection in the 'Organize File' dialogue is not properly initialized
defaults to 'Series' but is not functional, only selecting 'blank' and than back to 'Series/Movie' initializes the lower input fields/buttons correctly
I would like to have the series name in season folder
you may be already able to this but there is not way to see the supported patterns
When running autoorganize against Always sunny season 14, it names 7/10 episodes as "Episode #S.E" and the other 3 are named correctly. All 10 files are named with the same pattern.
I cloned autoorganize and launched with debugging against a new clean emby portable instance and it names all of the files correctly, so I made sure to match settings between installs and it still consistently does this.
Both instances are using 1.5.6.0 autoorganize and emby 4.4.2.0
Getting an Emby.AutoOrganize.Core.OrganizationException error when trying to organize an existing episode. Instead of updating the episode, it throws the exception and says file already exists in the log. It should replace the file like it used to even if you don't check the overwrite existing episode checkbox.
I would like to see more features in the Auto Organise plugin.
Like MediaElch renaming with advanced tags for resolution, codecs and so on.
Existing series in library is spread over multiple drives, I add a new drive when existing drive is full, I want to implicitly specify which drive to save the file in.
Even if my folders have their starting letter properly capitalized, autoorganize creates a separate folder that is lower case and that confuses emby.
Is this the expected behavior?
Hi,
Using the Emby repository for Synology my server is on 3.4.1.0 and the plugin has 1.2.3.0 - no update available. Here in GitHub it's 1.2.8.
Or are the updates are delayed?
When I have a duplicate TV show episode that already got sorted into a folder, but the new one is a REPACK/correct version, the file will not move into the folder and replace the old one - it says Internal Error.
When moving the media files move the subtitle files with them.
If there are subtitle files check filenames for language codes and maybe inside pluggin settings select which language you'd like it to move or allow to move/rename all with language suffix as per Emby Wiki
Anime episodes often are just numbered without any season. Would be quite helpful if auto-organize allows to create smart matches for that use case.
Example:
stars-sword.art.online.e04.480p.mkv
TV shows work just fine, but with movies, I do have problems getting it to work at all. No matter which movie I try, I always get this message:
When moving the movie manually into the "Movies" directory, it will be recognised just fine after the library update is running through, but not via Auto Organize.
My configuration:
On my media server, at least for the movies, I have them sorted into folders with just their starting letter. I don't really know how to articulate it, so here is a visualization of the file structure:
Movies
|
+---C
| +---Christmas Carol, A (2009)
| | A Christmas Carol (2009).eng.srt
| | A Christmas Carol (2009).movie_extension
| | A Christmas Carol (2009).nfo
| |
| \---Christmas Story, A (1883)
| A Christmas Story (1983).eng.srt
| A Christmas Story (1983).movie_extension
| A Christmas Story (1983).nfo
|
\---H
+---How The Grinch Stole Christmas (1966)
| How The Grinch Stole Christmas (1966).eng.srt
| How The Grinch Stole Christmas (1966).movie_extension
| How The Grinch Stole Christmas (1966).nfo
|
\---How The Grinch Stole Christmas (2000)
How The Grinch Stole Christmas (2000).eng.srt
How The Grinch Stole Christmas (2000).movie_extension
How The Grinch Stole Christmas (2000).nfo
It would be very much appreciated to add the option in the sorting system to place the files inside of a folder with it's starting letter.
For some movies I have, I will have a 1080p file, and a 4K file if available.
Auto Organise will not correctly set these, and will try to overwrite one of them with the other because it thinks they are the same.
If AO could add resolutions of files into the name, Emby can correctly display the option and not transcode when the higher res file is not needed. Like below.
Thanks
Would It be possible to have it so when a match is not found AutoOrganize looks 1 or 2 directories up for the Series name? Many Downloads have the folder Structure \Series Name\Season X\Episode file.xxx and AutoOrganize fails to match these files is the Series name is not in the file name.
Just what the title says. It'd be nice not to have to duplicate files or move files from where another process may be expecting them.
It seems to me that the order in which the meta data provider are configured for my library have a impact if metadata is found AT ALL.
I just tried to add tv show Power S01E07. With a setting "TheTVDB" > "The Open Movie Database" > "TheMovieDb" I get an error like this in the log and Auto Organize is not organising the episode:
2019-06-06 17:32:44.740 Error HttpServer: Error processing request
*** Error Report ***
Version: 4.1.1.0
Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
Operating system: Unix 4.9.0.3
64-Bit OS: True
64-Bit Process: True
User Interactive: True
Runtime: file:///system/System.Private.CoreLib.dll
Processor count: 8
Program data path: /config
Application directory: /system
System.Exception: System.Exception: No provider metadata found for Power (2014) season 1 episode 7
at Emby.AutoOrganize.Core.FileOrganizationService.PerformOrganization(EpisodeFileOrganizationRequest request)
Source: Emby.AutoOrganize
TargetSite: Void MoveNext()
If I use "TheMovieDB" as the first meta data provider it works.
%s_n-%sy
%s_n_s%0se%0e_%e_n.%ext
Original series Name: Star Trek: The Next Generation
Directory name and file name are sanitized the same way
Star_Trek _The_Next_Generation-1987
Star_Trek_The_Next_Generation_s04e07_Reunion
The issue here seems to be the :
in the series name. In the filename, it is removed completely, in the directory name it's just replaced with a space. This seems to be inconsistent behaviour.
if activated even episodes with different extensions get overwritten, and the old extension persists
eg: (new)s01e01.mkv -> (existing)s01.e01.ts results in (new)s01e01.ts
so it should either keep the new extension or much better not overwrite different extensions by default and make it an option
different extensions mostly means different fileformats, so some would keep the different formats intentionally
the pattern %mn
is in the form Movie Name (Year)
%mn
should be reduced to movie name only and for the year a new pattern should be created
this is nothing big, but maybe the planed organize task could be delayed/skipped, while a manual sorting is currently running
Hi, since the Update for Emby to version 4.2.0.40 AutoOrganize doesn't work anymore. Here is what I found in de logs:
2019-08-01 07:13:32.556 Info HttpClient: GET https://www.thetvdb.com/api/B89CE93890E9419B/series/311902/all/en.zip
2019-08-01 07:13:33.043 Error ProviderManager: Error searching
*** Error Report ***
Version: 4.2.0.40
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: Unix 4.15.0.55
64-Bit OS: True
64-Bit Process: True
User Interactive: True
Runtime: file:///opt/emby-server/system/System.Private.CoreLib.dll
Processor count: 4
Program data path: /var/lib/emby
Application directory: /opt/emby-server/system
MediaBrowser.Model.Net.HttpException: MediaBrowser.Model.Net.HttpException: NotFound
at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
at Tvdb.TvdbSeriesProvider.DownloadSeriesZip(String seriesId, String idType, String seriesName, Nullable`1 seriesYear, String seriesDataPath, Nullable`1 lastTvDbUpdateTime, String preferredMetadataLanguage, String saveAsMetadataLanguage, CancellationToken cancellationToken)
at Tvdb.TvdbSeriesProvider.DownloadSeriesZip(String seriesId, String idType, String seriesName, Nullable`1 seriesYear, String seriesDataPath, Nullable`1 lastTvDbUpdateTime, String preferredMetadataLanguage, CancellationToken cancellationToken)
at Tvdb.TvdbSeriesProvider.EnsureSeriesInfo(Dictionary`2 seriesProviderIds, String seriesName, Nullable`1 seriesYear, String preferredMetadataLanguage, CancellationToken cancellationToken)
at Tvdb.TvdbEpisodeProvider.GetSearchResults(EpisodeInfo searchInfo, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.ProviderManager.GetSearchResults[TLookupType](IRemoteSearchProvider`1 provider, TLookupType searchInfo, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.ProviderManager.GetRemoteSearchResults[TItemType,TLookupType](RemoteSearchQuery`1 searchInfo, BaseItem referenceItem, CancellationToken cancellationToken)
Source: Emby.Server.Implementations
TargetSite: Void MoveNext()
2019-08-01 07:13:33.064 Info HttpClient: GET https://private.omdbapi.com?apikey=fe53f97e&plot=full&r=json&i=tt1399045&Episode=1&Season=3
2019-08-01 07:13:33.208 Info HttpClient: GET https://api.themoviedb.org/3/tv/67133/season/3/episode/1?api_key=f6bd687ffa63cd282b6ff2c6877f2669&append_to_response=images,external_ids,credits,videos&language=de&include_image_language=de,null,en
2019-08-01 07:13:33.844 Warn App: No provider metadata found for MacGyver (2016) season 3 episode 1
2019-08-01 07:13:33.850 Error HttpServer: Error processing request
*** Error Report ***
Version: 4.2.0.40
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: Unix 4.15.0.55
64-Bit OS: True
64-Bit Process: True
User Interactive: True
Runtime: file:///opt/emby-server/system/System.Private.CoreLib.dll
Processor count: 4
Program data path: /var/lib/emby
Application directory: /opt/emby-server/system
System.Exception: System.Exception: No provider metadata found for MacGyver (2016) season 3 episode 1
at Emby.AutoOrganize.Core.FileOrganizationService.PerformOrganization(EpisodeFileOrganizationRequest request)
Source: Emby.AutoOrganize
TargetSite: Void MoveNext()```
I like to organize my movies by year/name, e.g. "Library/Movies/2019/Movie name (2019)/
".
When i set Movie folder pattern to "%my/%mn (%my)
", the slash gets replaced by a space, and the movie gets sorted into "Library/Movies/2019 Movie name (2019)/
".
Not sure what the best way to solve this is, but i don't think slash should be considered an invalid char for this pattern.
season/episode dont get preselected in the corresponding input fields for manual sorting
broken since v1.2.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.