mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
FileSystem: Using a single folder for shows-content
This commit is contained in:
parent
87e1b5aca1
commit
b60046eddc
@ -175,12 +175,15 @@ namespace Kyoo.Controllers
|
||||
Track track => _GetFileSystemForPath(track.Episode.Show.Path, out string _),
|
||||
_ => _GetFileSystemForPath(_options.CurrentValue.MetadataPath, out string _)
|
||||
};
|
||||
string path = await fs.GetExtraDirectory(resource);
|
||||
if (resource is IResource res)
|
||||
path ??= Combine(_options.CurrentValue.MetadataPath, res.Slug, typeof(T).Name);
|
||||
else
|
||||
path ??= Combine(_options.CurrentValue.MetadataPath, typeof(T).Name);
|
||||
await CreateDirectory(path);
|
||||
string path = await fs.GetExtraDirectory(resource)
|
||||
?? resource switch
|
||||
{
|
||||
Season season => await GetExtraDirectory(season.Show),
|
||||
Episode episode => await GetExtraDirectory(episode.Show),
|
||||
Track track => await GetExtraDirectory(track.Episode),
|
||||
IResource res => Combine(_options.CurrentValue.MetadataPath, typeof(T).Name, res.Slug),
|
||||
_ => Combine(_options.CurrentValue.MetadataPath, typeof(T).Name)
|
||||
};
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
@ -127,9 +127,9 @@ namespace Kyoo.Controllers
|
||||
return Task.FromResult(resource switch
|
||||
{
|
||||
Show show => Combine(show.Path, "Extra"),
|
||||
Season season => Combine(season.Show.Path, "Extra", "Season"),
|
||||
Episode episode => Combine(episode.Show.Path, "Extra", "Episode"),
|
||||
Track track => Combine(track.Episode.Show.Path, "Track"),
|
||||
Season season => Combine(season.Show.Path, "Extra"),
|
||||
Episode episode => Combine(episode.Show.Path, "Extra"),
|
||||
Track track => Combine(track.Episode.Show.Path, "Extra"),
|
||||
_ => null
|
||||
});
|
||||
}
|
||||
|
@ -94,9 +94,18 @@ namespace Kyoo.Controllers
|
||||
Images.Poster => "poster.jpg",
|
||||
Images.Logo => "logo.jpg",
|
||||
Images.Thumbnail => "thumbnail.jpg",
|
||||
Images.Trailer => "trailer.mp4",
|
||||
_ => $"{imageID}.jpg"
|
||||
};
|
||||
|
||||
imageName = item switch
|
||||
{
|
||||
Season season => $"season-{season.SeasonNumber}-{imageName}",
|
||||
Episode episode => _files.Combine("Thumbnails",
|
||||
$"{Path.GetFileNameWithoutExtension(episode.Path)}-{imageName}"),
|
||||
_ => imageName
|
||||
};
|
||||
|
||||
return _files.Combine(await _files.GetExtraDirectory(item), imageName);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user