Format code

This commit is contained in:
Zoe Roux 2024-04-02 23:24:24 +02:00
parent 8a639a3aee
commit 8758c7447e
No known key found for this signature in database
6 changed files with 15 additions and 26 deletions

View File

@ -16,7 +16,7 @@ RUN dotnet restore -a $TARGETARCH
COPY . .
ARG VERSION
RUN dotnet publish -a $TARGETARCH --no-restore -c Release -o /app "-p:Version=${VERSION:-"0.0.0-dev"}" src/Kyoo.Host
RUN dotnet publish -a $TARGETARCH --no-restore -c Release -o /app "-p:Version=${VERSION:-"0.0.0-dev"}" src/Kyoo.Core
FROM mcr.microsoft.com/dotnet/aspnet:8.0
RUN apt-get update && apt-get install -y curl

View File

@ -34,7 +34,7 @@ public static class CoreModule
public static IServiceProvider Services { get; set; }
public static void AddRepository<T, TRepo>(this IServiceCollection services)
where T:IResource
where T : IResource
where TRepo : class, IRepository<T>
{
services.AddScoped<TRepo>();

View File

@ -147,13 +147,12 @@ public static class MeilisearchModule
/// <inheritdoc />
public static void ConfigureMeilisearch(this WebApplicationBuilder builder)
{
builder
.Services.AddSingleton(
new MeilisearchClient(
builder.Configuration.GetValue("MEILI_HOST", "http://meilisearch:7700"),
builder.Configuration.GetValue<string?>("MEILI_MASTER_KEY")
)
);
builder.Services.AddSingleton(
new MeilisearchClient(
builder.Configuration.GetValue("MEILI_HOST", "http://meilisearch:7700"),
builder.Configuration.GetValue<string?>("MEILI_MASTER_KEY")
)
);
builder.Services.AddScoped<ISearchManager, SearchManager>();
builder.Services.AddSingleton<MeiliSync>();
}

View File

@ -112,10 +112,7 @@ public partial class UseDateOnly : Migration
"action,adventure,animation,comedy,crime,documentary,drama,family,fantasy,history,horror,music,mystery,romance,science_fiction,thriller,war,western"
)
.OldAnnotation("Npgsql:Enum:status", "unknown,finished,airing,planned")
.OldAnnotation(
"Npgsql:Enum:watch_status",
"completed,watching,droped,planned,deleted"
);
.OldAnnotation("Npgsql:Enum:watch_status", "completed,watching,droped,planned,deleted");
migrationBuilder.AlterColumn<DateTime>(
name: "start_air",

View File

@ -23,10 +23,7 @@ public partial class AddGenres : Migration
"action,adventure,animation,comedy,crime,documentary,drama,family,fantasy,history,horror,music,mystery,romance,science_fiction,thriller,war,western"
)
.OldAnnotation("Npgsql:Enum:status", "unknown,finished,airing,planned")
.OldAnnotation(
"Npgsql:Enum:watch_status",
"completed,watching,droped,planned,deleted"
);
.OldAnnotation("Npgsql:Enum:watch_status", "completed,watching,droped,planned,deleted");
}
/// <inheritdoc />
@ -45,9 +42,6 @@ public partial class AddGenres : Migration
"action,adventure,animation,comedy,crime,documentary,drama,family,fantasy,history,horror,music,mystery,romance,science_fiction,thriller,war,western,kids,news,reality,soap,talk,politics"
)
.OldAnnotation("Npgsql:Enum:status", "unknown,finished,airing,planned")
.OldAnnotation(
"Npgsql:Enum:watch_status",
"completed,watching,droped,planned,deleted"
);
.OldAnnotation("Npgsql:Enum:watch_status", "completed,watching,droped,planned,deleted");
}
}

View File

@ -75,11 +75,10 @@ class TheMovieDatabase(Provider):
if isinstance(x, list):
return [j for i in x for j in flatten(i)]
return [x]
return flatten([
self.genre_map[x["id"]]
for x in genres
if x["id"] in self.genre_map
])
return flatten(
[self.genre_map[x["id"]] for x in genres if x["id"] in self.genre_map]
)
def get_languages(self, *args):
return self._languages + list(args)