Git Product home page Git Product logo

emby.autoorganize's Introduction

emby-auto-organize

Auto-organize plugin for Emby Server

emby.autoorganize's People

Contributors

andy29485 avatar hatharry avatar lukepulverenti avatar poppypop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emby.autoorganize's Issues

System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/volume2/download/@eaDir/[email protected]

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

Remember Correction puts season/episode to Smart Match

Hi,

I have some files from for example Navy CIS named "euhd-ncis-sXXeYX.mkv". After manually matching them, the result in the Smart Matches always look like this:
screenshot_20180519-091224 2
So the auto organising is not working for new episodes.

Thanks
Jankete

ignore folder(s) for the enable auto-organize type

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.

'Organize File' dialogue not properly initialized

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

Episode Name Incorrect - "Episode #14.1"

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

Error when trying to update existing episode.

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.

https://emby.media/community/index.php?/topic/60882-auto-organize-not-working-when-replacing-existing-episodes/

https://emby.media/community/index.php?/topic/64627-auto-organise-enhancement-force-replacement-on-request-when-blue/

No plugin updates

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?

Internal Error

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.

Feature Request: Support SRT Organization

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

smart match for episodes w/o season

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

Movies don't seem to be recognised

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:

image

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:

image

Feature Request: Increased Folder Structure Options

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.

Feature Request: File resolution variable in tv/movie file pattern setting

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

Thanks

Feature Request: Have AutoOrganize look 2 Directories up for Series Name

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.

Order of metadata provider matters

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.

Sanitizing missmatch in folder and file names

Configuration:

  • Series directory pattern: %s_n-%sy
  • Episode file pattern: %s_n_s%0se%0e_%e_n.%ext

Example:

Original series Name: Star Trek: The Next Generation

Expected Behaviour:

Directory name and file name are sanitized the same way

Actual Behaviour:

  • Directory: Star_Trek _The_Next_Generation-1987
  • Episode: Star_Trek_The_Next_Generation_s04e07_Reunion

Observed Issue:

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.

Overwrites even if extension is different

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

AutoOrganize not working with Emby 4.2.0.40

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()```

Slash ('/') in MovieFolderPattern gets replaced by Space (' ') in GetValidFilename

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.