Jump to content

Upgrade to 4.9.x .embyignore not being correctly obeyed


Recommended Posts

sean.m.armstrong
Posted (edited)

Emby server (emby/embyserver) hosted via Docker on Unraid. 

File structures for Movies, TV, and Music follow these examples:

\Movies
|   Starship Troopers (1997).mkv
|   After the Thin Man (1936).mkv
|   Fantasia.mkv
|   Westworld (1973).mkv
|       
+---2001 A Space Odyssey (1968)
|   |   2001 A Space Odyssey (1968).mkv
|   |   
|   +---!ALT_LR
|   |       .embyignore
|   |       .ignore
|   |       .nomedia
|   |       2001 A Space Odyssey (1968).mkv
|   |       
|   \---Extras
|           2001 A Space Odyssey (1968) - Extras - 2001 A Space Odyssey, A Look Behind the Future.mkv
|           2001 A Space Odyssey (1968) - Extras - 2001, FX and Early Conceptual Artwork.mkv
|
+---Black Swan (2010)
    |   Black Swan (2010).m4v
    |   
    \---!ISOs
            .embyignore
            .ignore
            .nomedia
            Black Swan (2010).iso


\TV
+---Toast of London
|   |   Toast of London - 0x01 - The Unspeakable Play Special (Pilot).mkv
|   |   Toast of London - 1x01 - Addictive Personality.mkv
|   |   Toast of London - 1x02 - Afternoon Tea - 1080p.mkv
|   |   Toast of London - 1x02 - Afternoon Tea - 720p.mkv
|   |   Toast of London - 1x03 - Vanity Project.mkv
|   |   
|   \---!ALT_LR
|           .embyignore
|           .ignore
|           .nomedia
|           Toast of London - 1x01 - Addictive Personality.mkv
|           Toast of London - 1x02 - Afternoon Tea.mkv
|           Toast of London - 1x03 - Vanity Project.mkv
|
+---Good Omens (2019)
    |   .backup
    |   Good Omens (2019) - 1x01 - In the Beginning.m4v
    |   Good Omens (2019) - 1x02 - The Book.m4v
    |   Good Omens (2019) - 1x03 - Hard Times.m4v
    |   
    \---!ISOs
            .embyignore
            .ignore
            .nomedia
            Good Omens - Disc 1.iso
            Good Omens - Disc 2.iso


\Music
\---The Crystal Method
    +---!ALT_LR
    |   |   .embyignore
    |   |   .ignore
    |   |   .nomedia
    |   |   
    |   \---The Crystal Method - Vegas
    |           folder.jpg
    |           The Crystal Method - Vegas - 01 - Trip Like I Do.mp3
    |           The Crystal Method - Vegas - 02 - Busy Child.mp3
    |           The Crystal Method - Vegas.jpg
    |           
    +---!Archive
    |   |   .embyignore
    |   |   .ignore
    |   |   .nomedia
    |   |   
    |   \---The Crystal Method - Vegas
    |           folder.jpg
    |           The Crystal Method - Vegas.cue
    |           The Crystal Method - Vegas.jpg
    |           The Crystal Method - Vegas.wav
    |           
    \---The Crystal Method - Vegas
            folder.jpg
            The Crystal Method - Vegas - 01 - Trip Like I Do.flac
            The Crystal Method - Vegas - 02 - Busy Child.flac
            The Crystal Method - Vegas.jpg

Sub-folders whose name begin with a bang (!) are used for various purposes (e.g. archives, specific quality versions for mobile/storage constrained devices, rarely utiilzed alternates, etc..). All contain a ".nomedia" and ".ignore" file, and now have ".embyignore" file as well. All ".embyignore" files contain only a single asterisk.

 

Immediately after upgrade from 4.8.11.0 --> 4.9.x everything appears fine... until a library file scan runs. 
After the scan, folders/files that should be ignored due to the "*" in the ".embyignore" are included in the library.

Many of the folders appear empty in the Emby UI, though on the FS they're populated with files. I suspect this may be due to their content not being playable by the library type they're assigned in Emby? (e.g. .jpg files in a TV show library)

I'm attaching screenshots and a log. Let me know if there's anything else I can provide. 

Thanks.

Tv-shows-with-Alt_Lr.jpg

Alt_Lr-and-Isos.jpg

Isos-and-movies.jpg

embyserver.txt

Edited by sean.m.armstrong
double paste
GrimReaper
Posted
3 hours ago, sean.m.armstrong said:

After the scan, folders/files that should be ignored due to the "*" in the ".embyignore" are included in the library.

You have .embyignore at the wrong level, you need to move it one level up. To hide a folder, you need to place it in the root and its contents should be name(s) od the folder(s) you'd want ignored. 

In you example, you'd put .embyignore file containing

/!ALT_LR

under

2001 A Space Odyssey (1968)

folder. 

3 hours ago, sean.m.armstrong said:

Many of the folders appear empty in the Emby UI, though on the FS they're populated with files. I suspect this may be due to their content not being playable by the library type they're assigned in Emby?

No, but because you have .embyignore folder with "*" within:

Quote

Support for the legacy .ignore will still be lightly supported. It will act as an equivalent to .embyignore containing * - which means hide everything in the folder but not the folder itself. 

Excluding Files & Folders

  • Thanks 1
sean.m.armstrong
Posted

Thanks @GrimReaper and @Luke,

Yeah, it helps somewhat... 

I'd read the doc (https://emby.media/support/articles/Excluding-Files-Folders.html) but what was probably more helpful was the first sentence of the linked forum post "We will be moving to a new ignore mechanism that will function identically with .gitignore". That gave a lot more insight. 

So, if that's the case, shouldn't a single ".embyignore" file in the root of the Library FS folder (e.g. "Movies/.embyignore") containing something like:

**/!*

cover my use-case since all the folders I'm wanting to ignore begin with a "!"? 

 

A quick test with a mocked folder/file structure and the above .gitignore gave positive results using git check-ignore -v.

In practice, after trying many many permutations of gitignore globbing patterns I wasn't able to use that strategy. In most cases the undesired folders were still included, in the others any file/folder name containing "!" anywhere after the first char were ignored.

Doing a recursive FS scan for any folder starting with "!" and adding all of them to the root-level .embyignore in the same format as above (e.g. **/!ALT_LR) seems to have worked. So I suppose I could go that route. Sadly, I still had to roll back to 4.8.11 though because after the first scan, even though the correct items appeared to be ignored, there were lots instances of stuff like TV show extras suddenly showing up as episode within seasons, most audiobooks showing 2 copies of the same book, etc... 
IDK, maybe my data is a bit hatched somewhere. It's been around since v4.3. 

Let me know if you have any other thoughts or anything I can provide. Thanks again. 

Posted

Yea our evaluation of gitignore rules i think is generally pretty good, but I’m sure there are going to be tricky cases like this that need to be looked at. Thanks.

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