Format code

This commit is contained in:
Zoe Roux 2024-02-19 16:57:35 +01:00
parent 8269d80620
commit a3172c7918
8 changed files with 14 additions and 19 deletions

View File

@ -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.

View File

@ -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; }

View File

@ -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();

View File

@ -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));

View File

@ -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)

View File

@ -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 />

View File

@ -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)

View File

@ -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() {