add logo to collection list + minor changes
This commit is contained in:
1 parent
c3294a1ab9
commit
3076406b58
13 files changed
+49
-35
No files matched your search
+1
-1
@@ -4,7 +4,7 @@
|
||||
<td>
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<div class="product-box">
|
||||
<img src="https://picsum.photos/70" width="70" class="rounded-3" alt="">
|
||||
<img [src]="getLogoPath()" width="80" class="rounded-3" alt="">
|
||||
</div>
|
||||
<div class="product-info">
|
||||
<a href="javascript:;" class="product-title">{{entry.title}}</a>
|
||||
|
||||
+22
@@ -64,6 +64,28 @@ export class CollectionTableLineComponent implements OnInit {
|
||||
return `https://image.tmdb.org/t/p/w500` + this.entry.poster_path;
|
||||
}
|
||||
|
||||
getLogoPath() {
|
||||
// * Is in library: use a local logo
|
||||
if (this.entry.medias) {
|
||||
const selectedLogos = this.entry.medias.filter(
|
||||
(m) => m.type == 'logo' && m.is_selected
|
||||
);
|
||||
|
||||
if (
|
||||
selectedLogos.length &&
|
||||
selectedLogos[0] &&
|
||||
selectedLogos[0].path
|
||||
) {
|
||||
const name = selectedLogos[0].path.split('.')[0];
|
||||
const extention = selectedLogos[0].path.split('.')[1];
|
||||
return `http://localhost:4000/api/v1/media/entries/logos/${name}.${extention}`;
|
||||
}
|
||||
}
|
||||
|
||||
// * No poster found, use default poster image as a last stand
|
||||
return 'assets/images/default/default-logo.png';
|
||||
}
|
||||
|
||||
removeEntryFromList() {
|
||||
const dialogRef = this.dialog.open(ConfirmModalComponent, {
|
||||
width: '400px',
|
||||
|
||||
Reference in new issue
Block a user