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 _),
|
Track track => _GetFileSystemForPath(track.Episode.Show.Path, out string _),
|
||||||
_ => _GetFileSystemForPath(_options.CurrentValue.MetadataPath, out string _)
|
_ => _GetFileSystemForPath(_options.CurrentValue.MetadataPath, out string _)
|
||||||
};
|
};
|
||||||
string path = await fs.GetExtraDirectory(resource);
|
string path = await fs.GetExtraDirectory(resource)
|
||||||
if (resource is IResource res)
|
?? resource switch
|
||||||
path ??= Combine(_options.CurrentValue.MetadataPath, res.Slug, typeof(T).Name);
|
{
|
||||||
else
|
Season season => await GetExtraDirectory(season.Show),
|
||||||
path ??= Combine(_options.CurrentValue.MetadataPath, typeof(T).Name);
|
Episode episode => await GetExtraDirectory(episode.Show),
|
||||||
await CreateDirectory(path);
|
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;
|
return path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,9 +127,9 @@ namespace Kyoo.Controllers
|
|||||||
return Task.FromResult(resource switch
|
return Task.FromResult(resource switch
|
||||||
{
|
{
|
||||||
Show show => Combine(show.Path, "Extra"),
|
Show show => Combine(show.Path, "Extra"),
|
||||||
Season season => Combine(season.Show.Path, "Extra", "Season"),
|
Season season => Combine(season.Show.Path, "Extra"),
|
||||||
Episode episode => Combine(episode.Show.Path, "Extra", "Episode"),
|
Episode episode => Combine(episode.Show.Path, "Extra"),
|
||||||
Track track => Combine(track.Episode.Show.Path, "Track"),
|
Track track => Combine(track.Episode.Show.Path, "Extra"),
|
||||||
_ => null
|
_ => null
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -94,9 +94,18 @@ namespace Kyoo.Controllers
|
|||||||
Images.Poster => "poster.jpg",
|
Images.Poster => "poster.jpg",
|
||||||
Images.Logo => "logo.jpg",
|
Images.Logo => "logo.jpg",
|
||||||
Images.Thumbnail => "thumbnail.jpg",
|
Images.Thumbnail => "thumbnail.jpg",
|
||||||
|
Images.Trailer => "trailer.mp4",
|
||||||
_ => $"{imageID}.jpg"
|
_ => $"{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);
|
return _files.Combine(await _files.GetExtraDirectory(item), imageName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user