advplyr / audiobookshelf

Self-hosted audiobook and podcast server
https://audiobookshelf.org
GNU General Public License v3.0
6.57k stars 466 forks source link

[Enhancement]: Ignore file similar to .gitignore and .plexignore #1641

Open hypnotoad08 opened 1 year ago

hypnotoad08 commented 1 year ago

Describe the feature/enhancement

This is a minor feature request as it doesn't affect functionality. I noticed that the Library files section for some of the audiobook files I have moved to my shared Audiobook folder on my Synology NAS are showing some hidden files/folders that are created by the NAS. Can the Library files section filter out these hidden files/folders? @eaDir

CLHatch commented 1 year ago

This is handled by Plex with .plexignore files that can be created to specify patterns of files/folders to be ignored. Something similar could be created for ABS. https://support.plex.tv/articles/201381883-special-keyword-file-folder-exclusion/

CLHatch commented 1 year ago

SyncThing has a similar file you can use to set files/folders to ignore.

advplyr commented 1 year ago

You can use a .ignore file

raphpa commented 1 year ago

It is a little bit more complicated with the @eaDir folder. The NAS creates it automatically in every folder with media in it. So if you have your library sorted in subfolders you would have to manually put the .ignore file manually into every single one of them. A global ignore option would be great for this case, especially if you autopopulate your library.

hypnotoad08 commented 1 year ago

Yes I was hoping for a global fix

theolike commented 1 year ago

Agreed. It has to be a configurable global filter. While this one is specifically a Synology quirk, there are many other systems that use a similar process for indexing, thumbnails, etc. For example, Windows and it's thumbs.db files. I haven't been through the indexer code yet (and I guess I should do that), but is there already filter logic in it, even if for only a hard coded list?

(Also, no matter what kind of spoon you are, "Journey before destination", Radiant.)

CLHatch commented 1 year ago

Agreed. It has to be a configurable global filter. While this one is specifically a Synology quirk, there are many other systems that use a similar process for indexing, thumbnails, etc. For example, Windows and it's thumbs.db files. I haven't been through the indexer code yet (and I guess I should do that), but is there already filter logic in it, even if for only a hard coded list?

(Also, no matter what kind of spoon you are, "Journey before destination", Radiant.)

Yeah, I actually just had to add an "ignore" option for one other folder in my SyncThing shares. I noticed that .@__thumb folders kept appearing in folders. It contained thumbnails of various sizes. Ends up, someone else in the share has a QNAP, it creates them. Added (?d).@__thumb, and all good (the (?d) tells SyncThing it's ok to delete the files if it's needed to delete the parent folder. Obviously flags like that aren't needed for ABS.)

DDriggs00 commented 1 year ago

Additionally, when deleting an item from the library only (not filesystem), it would be useful to add an option to create an ignore file on the offending directory.

iconoclasthero commented 1 year ago

mpd also has this and it would be useful to have .absignore similar to .mpdignore

nichwall commented 10 months ago

Doing a bit of research tonight looks like node-ignore may be a useful package for adding an ignore list. Just putting this here for reference. I couldn't find many resources for creating ignore list functionality (just kept getting references of how to use gitignore, plexignore, etc, not actual implementations)

https://github.com/kaelzhang/node-ignore

Edit to add: To add this to the UI, I think this would fit best as a new tab on library settings (so library specific ignores and only one set of ignores per library). There can either be a few default values with a "reset to defaults button", or a link to some documentation with some "good default values" that users need to manually enter. Similar to the SyncThing interface as mentioned before.

rage1337 commented 10 months ago

Found a workaround for my use case (described here): This approach helps me to exclude my workfolder: Stackoverflow

Added the line

- /audiobooks/_ the to the volume config of my docker-compose.yml The folder is there, but empty inside the container.

iconoclasthero commented 6 months ago

I think i put a FR in for this. I don't know what's going on above, but I could use this right now. Also, I'd want to behave the way that .mpdignore behaves so I could put tmp in .absignore in the root of the library and be done with it.