mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 04:04:21 -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.
|
/// Links to watch this episode.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public VideoLinks Links =>
|
public VideoLinks Links =>
|
||||||
new()
|
new() { Direct = $"/episode/{Slug}/direct", Hls = $"/episode/{Slug}/master.m3u8", };
|
||||||
{
|
|
||||||
Direct = $"/episode/{Slug}/direct",
|
|
||||||
Hls = $"/episode/{Slug}/master.m3u8",
|
|
||||||
};
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the slug of an episode.
|
/// Get the slug of an episode.
|
||||||
|
@ -153,11 +153,7 @@ namespace Kyoo.Abstractions.Models
|
|||||||
/// Links to watch this movie.
|
/// Links to watch this movie.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public VideoLinks Links =>
|
public VideoLinks Links =>
|
||||||
new()
|
new() { Direct = $"/movie/{Slug}/direct", Hls = $"/movie/{Slug}/master.m3u8", };
|
||||||
{
|
|
||||||
Direct = $"/movie/{Slug}/direct",
|
|
||||||
Hls = $"/movie/{Slug}/master.m3u8",
|
|
||||||
};
|
|
||||||
|
|
||||||
[SerializeIgnore]
|
[SerializeIgnore]
|
||||||
public ICollection<MovieWatchStatus>? Watched { get; set; }
|
public ICollection<MovieWatchStatus>? Watched { get; set; }
|
||||||
|
@ -68,7 +68,8 @@ public class WatchStatusRepository : IWatchStatusRepository
|
|||||||
DatabaseContext db = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
|
DatabaseContext db = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
|
||||||
WatchStatusRepository repo =
|
WatchStatusRepository repo =
|
||||||
scope.ServiceProvider.GetRequiredService<WatchStatusRepository>();
|
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)
|
.Where(x => x.ShowId == ep.ShowId && x.Status == WatchStatus.Completed)
|
||||||
.Select(x => x.UserId)
|
.Select(x => x.UserId)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
@ -110,7 +110,8 @@ namespace Kyoo.Core
|
|||||||
options.SuppressMapClientErrors = true;
|
options.SuppressMapClientErrors = true;
|
||||||
options.InvalidModelStateResponseFactory = ctx =>
|
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)
|
.Select(x => x.ErrorMessage)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
return new BadRequestObjectResult(new RequestError(errors));
|
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));
|
await _Proxy($"/{quality}/{segment}", await GetPath(identifier));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpGet("{identifier:id}/audio/{audio}/index.m3u8")]
|
[HttpGet("{identifier:id}/audio/{audio}/index.m3u8")]
|
||||||
[PartialPermission(Kind.Play)]
|
[PartialPermission(Kind.Play)]
|
||||||
public async Task GetAudioIndex(Identifier identifier, string audio)
|
public async Task GetAudioIndex(Identifier identifier, string audio)
|
||||||
|
@ -46,7 +46,9 @@ namespace Kyoo.Postgresql.Migrations
|
|||||||
);
|
);
|
||||||
|
|
||||||
// language=PostgreSQL
|
// 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 />
|
/// <inheritdoc />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user