Adding tests for the new font support

This commit is contained in:
Zoe Roux 2022-04-15 22:56:42 +02:00
parent a71c22db92
commit 6348ae9aa6
No known key found for this signature in database
GPG Key ID: 6AA5AE82CCC0D9DD
5 changed files with 5 additions and 34 deletions

View File

@ -27,22 +27,6 @@ We are going to take a look at the fields you might want to change to tailor Kyo
- ```pluginsPath```: The directory where the plugins are stored
- ```transmuxPath```: The directory where the transmux-ed video are stored (used as a cache)
- ```transcodePath```: The directory where the transcoded video are stored (used as a cache)
- ```metadataInShow```: A boolean telling if the Movie/Show metadata (posters, extracted subtitles, Chapters) will be stored in the same directory as the video, in an ```Extra``` directory, or in the ```metadataPath```.
For example, if ```metadataInShow``` is true, your file tree wil look something like this:
```bash
/my-movies
|
-- My First Movie/
|
-- My First Movie.mp4
-- Extra/
|
-- poster.jpe
-- etc...
```
**Warning** Therefore, if your shows are not in individual folders, it is recommended to set ```metadataInShow``` to ```false```. If you don't, all the shows will share the same metadata we are sure you don't want that ;)
- ```database```
- ```enabled```: Which database to use. Either ```sqlite``` (by default) or ```postgres```. SQLite is easier to use & manage if you don't have an SQL server on your machine. However, if you have a large amount of videos, we recommend using Postgres, which is more powerful to manage large databases

View File

@ -61,7 +61,7 @@ namespace Kyoo.Abstractions.Models
Slug = Utility.ToSlug(PathIO.GetFileNameWithoutExtension(path));
Path = path;
File = PathIO.GetFileName(path);
Format = PathIO.GetExtension(path);
Format = PathIO.GetExtension(path).Replace(".", string.Empty);
}
}
}

View File

@ -200,7 +200,7 @@ namespace Kyoo.Abstractions.Models
ReleaseDate = ep.ReleaseDate,
Path = ep.Path,
Images = ep.Show.Images,
Container = PathIO.GetExtension(ep.Path)![1..],
Container = PathIO.GetExtension(ep.Path).Replace(".", string.Empty),
Video = ep.Tracks.FirstOrDefault(x => x.Type == StreamType.Video),
Audios = ep.Tracks.Where(x => x.Type == StreamType.Audio).ToArray(),
Subtitles = ep.Tracks.Where(x => x.Type == StreamType.Subtitle).ToArray(),

View File

@ -221,10 +221,10 @@ namespace Kyoo.Core.Controllers
{
string path = _files.Combine(await _files.GetExtraDirectory(episode), "Attachments");
string font = (await _files.ListFiles(path))
.FirstOrDefault(x => Utility.ToSlug(Path.GetFileName(x)) == slug);
.FirstOrDefault(x => Utility.ToSlug(Path.GetFileNameWithoutExtension(x)) == slug);
if (font == null)
return null;
return new Font(path);
return new Font(font);
}
/// <inheritdoc />

View File

@ -17,7 +17,6 @@
// along with Kyoo. If not, see <https://www.gnu.org/licenses/>.
using System;
using Kyoo.Abstractions.Models;
namespace Kyoo.Core.Models.Options
{
@ -57,19 +56,7 @@ namespace Kyoo.Core.Models.Options
public string TranscodePath { get; set; } = "cached/transcode";
/// <summary>
/// <c>true</c> if the metadata of a show/season/episode should be stored in the same directory as video files,
/// <c>false</c> to save them in a kyoo specific directory.
/// </summary>
/// <remarks>
/// Some file systems might discard this option to store them somewhere else.
/// For example, readonly file systems will probably store them in a kyoo specific directory.
/// </remarks>
public bool MetadataInShow { get; set; } = true;
/// <summary>
/// The path for metadata if they are not stored near show (see <see cref="MetadataInShow"/>).
/// Some resources can't be stored near a show and they are stored in this directory
/// (like <see cref="Provider"/>).
/// The path where metadata is stored.
/// </summary>
public string MetadataPath { get; set; } = "metadata/";
}