2020-05-12 21:33:06 +00:00
|
|
|
using Emby.Server.Implementations.Library;
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
namespace Jellyfin.Server.Implementations.Tests.Library
|
|
|
|
{
|
|
|
|
public class IgnorePatternsTests
|
|
|
|
{
|
|
|
|
[Theory]
|
|
|
|
[InlineData("/media/small.jpg", true)]
|
2020-06-26 17:04:35 +00:00
|
|
|
[InlineData("/media/albumart.jpg", true)]
|
|
|
|
[InlineData("/media/movie.sample.mp4", true)]
|
2020-07-25 21:50:49 +00:00
|
|
|
[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)]
|
2020-05-12 21:33:06 +00:00
|
|
|
[InlineData("/media/movies/#Recycle/test.txt", true)]
|
|
|
|
[InlineData("/media/movies/#recycle/", true)]
|
2020-06-26 17:04:35 +00:00
|
|
|
[InlineData("/media/movies/#recycle", true)]
|
2020-05-12 21:33:06 +00:00
|
|
|
[InlineData("thumbs.db", true)]
|
|
|
|
[InlineData(@"C:\media\movies\movie.avi", false)]
|
2020-07-25 21:50:49 +00:00
|
|
|
[InlineData("/media/.hiddendir/file.mp4", false)]
|
2020-05-12 21:33:06 +00:00
|
|
|
[InlineData("/media/dir/.hiddenfile.mp4", true)]
|
2020-07-25 21:50:49 +00:00
|
|
|
[InlineData("/media/dir/._macjunk.mp4", true)]
|
2020-06-26 17:04:35 +00:00
|
|
|
[InlineData("/volume1/video/Series/@eaDir", true)]
|
|
|
|
[InlineData("/volume1/video/Series/@eaDir/file.txt", true)]
|
|
|
|
[InlineData("/directory/@Recycle", true)]
|
|
|
|
[InlineData("/directory/@Recycle/file.mp3", true)]
|
2020-07-25 21:50:49 +00:00
|
|
|
[InlineData("/media/movies/.@__thumb", true)]
|
|
|
|
[InlineData("/media/movies/.@__thumb/foo-bar-thumbnail.png", true)]
|
2020-05-12 21:33:06 +00:00
|
|
|
public void PathIgnored(string path, bool expected)
|
|
|
|
{
|
|
|
|
Assert.Equal(expected, IgnorePatterns.ShouldIgnore(path));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|