Format code

This commit is contained in:
Zoe Roux 2023-11-02 02:07:06 +01:00
parent a33171ba87
commit 66fff153e1
4 changed files with 11 additions and 8 deletions

View File

@ -26,9 +26,9 @@ using Kyoo.Abstractions.Models;
using Kyoo.Core; using Kyoo.Core;
using Kyoo.Core.Controllers; using Kyoo.Core.Controllers;
using Kyoo.Postgresql; using Kyoo.Postgresql;
using Microsoft.Extensions.DependencyInjection;
using Moq; using Moq;
using Xunit.Abstractions; using Xunit.Abstractions;
using Microsoft.Extensions.DependencyInjection;
namespace Kyoo.Tests.Database namespace Kyoo.Tests.Database
{ {

View File

@ -40,10 +40,9 @@ export const episodeDisplayNumber = (
}; };
export const displayRuntime = (runtime: number) => { export const displayRuntime = (runtime: number) => {
if (runtime < 60) if (runtime < 60) return `${runtime}min`;
return `${runtime}min`;
return `${Math.floor(runtime / 60)}h${runtime % 60}`; return `${Math.floor(runtime / 60)}h${runtime % 60}`;
} };
export const EpisodeBox = ({ export const EpisodeBox = ({
name, name,
@ -205,7 +204,8 @@ export const EpisodeLine = ({
</H6> </H6>
)} )}
</Skeleton> </Skeleton>
{isLoading || (runtime && <Skeleton>{isLoading || <SubP>{displayRuntime(runtime)}</SubP>}</Skeleton>)} {isLoading ||
(runtime && <Skeleton>{isLoading || <SubP>{displayRuntime(runtime)}</SubP>}</Skeleton>)}
</View> </View>
<Skeleton>{isLoading || <P numberOfLines={3}>{overview}</P>}</Skeleton> <Skeleton>{isLoading || <P numberOfLines={3}>{overview}</P>}</Skeleton>
</View> </View>

View File

@ -60,6 +60,7 @@ class Provider:
raise NotImplementedError raise NotImplementedError
@abstractmethod @abstractmethod
async def identify_collection(self, provider_id: str, *, language: list[str]) -> Collection: async def identify_collection(
self, provider_id: str, *, language: list[str]
) -> Collection:
raise NotImplementedError raise NotImplementedError

View File

@ -26,6 +26,8 @@ class Collection:
**asdict(self), **asdict(self),
**asdict(self.translations[default_language]), **asdict(self.translations[default_language]),
"poster": next(iter(self.translations[default_language].posters), None), "poster": next(iter(self.translations[default_language].posters), None),
"thumbnail": next(iter(self.translations[default_language].thumbnails), None), "thumbnail": next(
iter(self.translations[default_language].thumbnails), None
),
"logo": next(iter(self.translations[default_language].logos), None), "logo": next(iter(self.translations[default_language].logos), None),
} }