mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Format code
This commit is contained in:
parent
8269d80620
commit
a3172c7918
@ -269,11 +269,7 @@ namespace Kyoo.Abstractions.Models
|
||||
/// Links to watch this episode.
|
||||
/// </summary>
|
||||
public VideoLinks Links =>
|
||||
new()
|
||||
{
|
||||
Direct = $"/episode/{Slug}/direct",
|
||||
Hls = $"/episode/{Slug}/master.m3u8",
|
||||
};
|
||||
new() { Direct = $"/episode/{Slug}/direct", Hls = $"/episode/{Slug}/master.m3u8", };
|
||||
|
||||
/// <summary>
|
||||
/// Get the slug of an episode.
|
||||
|
@ -153,11 +153,7 @@ namespace Kyoo.Abstractions.Models
|
||||
/// Links to watch this movie.
|
||||
/// </summary>
|
||||
public VideoLinks Links =>
|
||||
new()
|
||||
{
|
||||
Direct = $"/movie/{Slug}/direct",
|
||||
Hls = $"/movie/{Slug}/master.m3u8",
|
||||
};
|
||||
new() { Direct = $"/movie/{Slug}/direct", Hls = $"/movie/{Slug}/master.m3u8", };
|
||||
|
||||
[SerializeIgnore]
|
||||
public ICollection<MovieWatchStatus>? Watched { get; set; }
|
||||
|
@ -68,7 +68,8 @@ public class WatchStatusRepository : IWatchStatusRepository
|
||||
DatabaseContext db = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
|
||||
WatchStatusRepository repo =
|
||||
scope.ServiceProvider.GetRequiredService<WatchStatusRepository>();
|
||||
List<Guid> users = await db.ShowWatchStatus.IgnoreQueryFilters()
|
||||
List<Guid> users = await db
|
||||
.ShowWatchStatus.IgnoreQueryFilters()
|
||||
.Where(x => x.ShowId == ep.ShowId && x.Status == WatchStatus.Completed)
|
||||
.Select(x => x.UserId)
|
||||
.ToListAsync();
|
||||
|
@ -110,7 +110,8 @@ namespace Kyoo.Core
|
||||
options.SuppressMapClientErrors = true;
|
||||
options.InvalidModelStateResponseFactory = ctx =>
|
||||
{
|
||||
string[] errors = ctx.ModelState.SelectMany(x => x.Value!.Errors)
|
||||
string[] errors = ctx
|
||||
.ModelState.SelectMany(x => x.Value!.Errors)
|
||||
.Select(x => x.ErrorMessage)
|
||||
.ToArray();
|
||||
return new BadRequestObjectResult(new RequestError(errors));
|
||||
|
@ -111,7 +111,6 @@ public abstract class TranscoderApi<T>(IRepository<T> repository, IThumbnailsMan
|
||||
await _Proxy($"/{quality}/{segment}", await GetPath(identifier));
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("{identifier:id}/audio/{audio}/index.m3u8")]
|
||||
[PartialPermission(Kind.Play)]
|
||||
public async Task GetAudioIndex(Identifier identifier, string audio)
|
||||
|
@ -46,7 +46,9 @@ namespace Kyoo.Postgresql.Migrations
|
||||
);
|
||||
|
||||
// language=PostgreSQL
|
||||
migrationBuilder.Sql("update users set permissions = ARRAY_APPEND(permissions, 'overall.play');");
|
||||
migrationBuilder.Sql(
|
||||
"update users set permissions = ARRAY_APPEND(permissions, 'overall.play');"
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -19,16 +19,16 @@ type FileStream struct {
|
||||
Keyframes []float64
|
||||
CanTransmux bool
|
||||
Info *MediaInfo
|
||||
videos CMap[Quality, *VideoStream]
|
||||
videos CMap[Quality, *VideoStream]
|
||||
audios CMap[int32, *AudioStream]
|
||||
}
|
||||
|
||||
func NewFileStream(path string, sha string, route string) *FileStream {
|
||||
ret := &FileStream{
|
||||
Path: path,
|
||||
Out: fmt.Sprintf("%s/%s", Settings.Outpath, sha),
|
||||
Path: path,
|
||||
Out: fmt.Sprintf("%s/%s", Settings.Outpath, sha),
|
||||
videos: NewCMap[Quality, *VideoStream](),
|
||||
audios: NewCMap[int32, *AudioStream](),
|
||||
audios: NewCMap[int32, *AudioStream](),
|
||||
}
|
||||
|
||||
ret.ready.Add(1)
|
||||
|
@ -181,7 +181,7 @@ func GetInfo(path string, sha string, route string) (*MediaInfo, error) {
|
||||
ret, _ := infos.GetOrCreate(sha, func() *MediaInfo {
|
||||
readyChan := make(chan struct{})
|
||||
mi := &MediaInfo{
|
||||
Sha: sha,
|
||||
Sha: sha,
|
||||
ready: readyChan,
|
||||
}
|
||||
go func() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user