mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-07 10:14:13 -04:00
Solving some type issues
This commit is contained in:
parent
4d2174287d
commit
ede2c9a234
@ -1,6 +1,7 @@
|
||||
import {ItemType, LibraryItem} from "../../models/resources/library-item";
|
||||
import {Show, ShowRole} from "../../models/resources/show";
|
||||
import {Collection} from "../../models/resources/collection";
|
||||
import {People} from "../../models/resources/people";
|
||||
|
||||
export class ItemsUtils
|
||||
{
|
||||
@ -12,7 +13,7 @@ export class ItemsUtils
|
||||
return "/show/" + item.slug;
|
||||
}
|
||||
|
||||
static getDate(item: LibraryItem | Show | ShowRole | Collection): string
|
||||
static getDate(item: LibraryItem | Show | ShowRole | Collection | People): string
|
||||
{
|
||||
if ("role" in item && item.role)
|
||||
{
|
||||
@ -23,6 +24,8 @@ export class ItemsUtils
|
||||
if ("type" in item && item.type && typeof item.type == "string")
|
||||
return item.type;
|
||||
|
||||
if (!("startYear" in item))
|
||||
return "";
|
||||
if (item.endYear && item.startYear != item.endYear)
|
||||
return `${item.startYear} - ${item.endYear}`
|
||||
return item.startYear?.toString();
|
||||
|
@ -32,7 +32,7 @@ export class CollectionComponent
|
||||
return this.sanitizer.bypassSecurityTrustStyle("url(" + this.collection.poster + ")");
|
||||
}
|
||||
|
||||
getDate(item: LibraryItem | Show | ShowRole | Collection)
|
||||
getDate(item: LibraryItem | Show | ShowRole | Collection | People)
|
||||
{
|
||||
return ItemsUtils.getDate(item);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@
|
||||
<div class="container-fluid mt-3">
|
||||
<mat-form-field>
|
||||
<mat-label>Season</mat-label>
|
||||
<mat-select [(value)]="season" (selectionChange)="getEpisodes(season.seasonNumber)">
|
||||
<mat-select [(value)]="season" (selectionChange)="getEpisodes(season)">
|
||||
<mat-option *ngFor="let season of this.seasons" [value]="season.seasonNumber">{{season.title}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
Loading…
x
Reference in New Issue
Block a user