Don't ignore dot directories.

Use `.ignore` file to hide directory from library scan.

Also, please tell me we handle sample matching somewhere else? This is a mess.
This commit is contained in:
Odd Stråbø 2020-07-25 23:50:49 +02:00
parent e3db0ac400
commit 11d5410dbb
2 changed files with 25 additions and 4 deletions

View File

@ -18,7 +18,17 @@ namespace Emby.Server.Implementations.Library
{
"**/small.jpg",
"**/albumart.jpg",
"**/*sample*",
// What is this reg ex you speak of?
"**/*.sample.?",
"**/*.sample.??",
"**/*.sample.????",
"**/*.sample.?????",
"**/sample.?",
"**/sample.??",
"**/sample.????",
"**/sample.?????",
"**/sample/*",
// Directories
"**/metadata/**",
@ -64,10 +74,13 @@ namespace Emby.Server.Implementations.Library
"**/.grab/**",
"**/.grab",
// Unix hidden files and directories
"**/.*/**",
// Unix hidden files
"**/.*",
// Mac - if you ever remove the above.
// "**/._*",
// "**/.DS_Store",
// thumbs.db
"**/thumbs.db",

View File

@ -9,17 +9,25 @@ namespace Jellyfin.Server.Implementations.Tests.Library
[InlineData("/media/small.jpg", true)]
[InlineData("/media/albumart.jpg", true)]
[InlineData("/media/movie.sample.mp4", true)]
[InlineData("/media/movie/sample.mp4", true)]
[InlineData("/media/movie/sample/movie.mp4", true)]
[InlineData("/foo/sample/bar/baz.mkv", false)]
[InlineData("/media/movies/the sample/the sample.mkv", false)]
[InlineData("/media/movies/sampler.mkv", false)]
[InlineData("/media/movies/#Recycle/test.txt", true)]
[InlineData("/media/movies/#recycle/", true)]
[InlineData("/media/movies/#recycle", true)]
[InlineData("thumbs.db", true)]
[InlineData(@"C:\media\movies\movie.avi", false)]
[InlineData("/media/.hiddendir/file.mp4", true)]
[InlineData("/media/.hiddendir/file.mp4", false)]
[InlineData("/media/dir/.hiddenfile.mp4", true)]
[InlineData("/media/dir/._macjunk.mp4", true)]
[InlineData("/volume1/video/Series/@eaDir", true)]
[InlineData("/volume1/video/Series/@eaDir/file.txt", true)]
[InlineData("/directory/@Recycle", true)]
[InlineData("/directory/@Recycle/file.mp3", true)]
[InlineData("/media/movies/.@__thumb", true)]
[InlineData("/media/movies/.@__thumb/foo-bar-thumbnail.png", true)]
public void PathIgnored(string path, bool expected)
{
Assert.Equal(expected, IgnorePatterns.ShouldIgnore(path));