diff --git a/DEPLOY.md b/DEPLOY.md index 5aa9203..b5a02fe 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -47,8 +47,8 @@ guide to switching back to the official build once the upstream fix lands. ./build-ytdlp.sh docker buildx build --platform linux/amd64 \ - --build-arg VERSION=1.22 \ - -t 192.168.2.212:3000/tigeren/metube:1.22 \ + --build-arg VERSION=1.25 \ + -t 192.168.2.212:3000/tigeren/metube:1.25 \ --push . ``` diff --git a/ui/src/app/download-card.component.html b/ui/src/app/download-card.component.html index a81efce..68d63cb 100644 --- a/ui/src/app/download-card.component.html +++ b/ui/src/app/download-card.component.html @@ -10,6 +10,7 @@
{{ row.value.title }}
+ {{ siteLabel(row.value.website) }} {{ folderLabel() }} {{ qualityLabel(row.value.quality) }} · {{ formatLabel(row.value.format) }} {{ relativeTime(row.value.timestamp) }} diff --git a/ui/src/app/download-card.component.sass b/ui/src/app/download-card.component.sass index 9bcbd27..6fe4e63 100644 --- a/ui/src/app/download-card.component.sass +++ b/ui/src/app/download-card.component.sass @@ -114,6 +114,11 @@ color: var(--fg) background: var(--surface) + &.site + color: var(--accent-strong) + background: var(--accent-tint) + border-color: oklch(85% 0.05 145) + &.fmt font-family: var(--font-mono) font-weight: 500 diff --git a/ui/src/app/download-card.component.ts b/ui/src/app/download-card.component.ts index d29cf0b..88a9c0c 100644 --- a/ui/src/app/download-card.component.ts +++ b/ui/src/app/download-card.component.ts @@ -3,7 +3,7 @@ import { faDownload, faExternalLinkAlt, faFolderPlus, faPlay, faRedoAlt, faTrash import { faCheckCircle, faTimesCircle } from '@fortawesome/free-regular-svg-icons'; import { Download, DownloadsService } from './downloads.service'; import { KeyedDownload } from './active-downloads.component'; -import { formatLabel, qualityLabel, relativeTime } from './labels'; +import { formatLabel, qualityLabel, relativeTime, siteLabel } from './labels'; @Component({ selector: 'app-download-card', @@ -37,6 +37,7 @@ export class DownloadCardComponent { qualityLabel = qualityLabel; formatLabel = formatLabel; relativeTime = relativeTime; + siteLabel = siteLabel; constructor(private downloads: DownloadsService) {} diff --git a/ui/src/app/download-row.component.html b/ui/src/app/download-row.component.html index e29c5b2..cb8fec7 100644 --- a/ui/src/app/download-row.component.html +++ b/ui/src/app/download-row.component.html @@ -10,6 +10,7 @@
{{ row.value.title }}
+ {{ siteLabel(row.value.website) }} {{ folderLabel() }} {{ qualityLabel(row.value.quality) }} · {{ formatLabel(row.value.format) }} {{ relativeTime(row.value.timestamp) }} diff --git a/ui/src/app/download-row.component.sass b/ui/src/app/download-row.component.sass index 9dd6bbb..3848802 100644 --- a/ui/src/app/download-row.component.sass +++ b/ui/src/app/download-row.component.sass @@ -103,6 +103,11 @@ color: var(--fg) background: var(--surface) + &.site + color: var(--accent-strong) + background: var(--accent-tint) + border-color: oklch(85% 0.05 145) + &.fmt font-family: var(--font-mono) font-weight: 500 diff --git a/ui/src/app/download-row.component.ts b/ui/src/app/download-row.component.ts index 5e52dc3..6530d7f 100644 --- a/ui/src/app/download-row.component.ts +++ b/ui/src/app/download-row.component.ts @@ -3,7 +3,7 @@ import { faDownload, faExternalLinkAlt, faFolderPlus, faPlay, faRedoAlt, faTrash import { faCheckCircle, faTimesCircle } from '@fortawesome/free-regular-svg-icons'; import { Download, DownloadsService } from './downloads.service'; import { KeyedDownload } from './active-downloads.component'; -import { formatLabel, qualityLabel, relativeTime } from './labels'; +import { formatLabel, qualityLabel, relativeTime, siteLabel } from './labels'; @Component({ selector: 'app-download-row', @@ -39,6 +39,7 @@ export class DownloadRowComponent { qualityLabel = qualityLabel; formatLabel = formatLabel; relativeTime = relativeTime; + siteLabel = siteLabel; constructor(private downloads: DownloadsService) {} diff --git a/ui/src/app/labels.ts b/ui/src/app/labels.ts index 572d2c5..0ac26ce 100644 --- a/ui/src/app/labels.ts +++ b/ui/src/app/labels.ts @@ -32,6 +32,28 @@ export function formatLabel(id: string): string { return FORMAT_LABELS[id] || id; } +const SITE_LABELS: { [id: string]: string } = { + 'youtube.com': 'YouTube', + 'm.youtube.com': 'YouTube', + 'youtu.be': 'YouTube', + 'vimeo.com': 'Vimeo', + 'dailymotion.com': 'Dailymotion', + 'twitch.tv': 'Twitch', + 'twitter.com': 'Twitter', + 'x.com': 'X', + 'facebook.com': 'Facebook', + 'instagram.com': 'Instagram', + 'tiktok.com': 'TikTok', + 'reddit.com': 'Reddit' +}; + +/** Short display name for a source site given its domain (e.g. www.youtube.com -> YouTube). */ +export function siteLabel(website: string): string { + if (!website) return ''; + const simplified = website.replace(/^www\./i, '').toLowerCase(); + return SITE_LABELS[simplified] || simplified.split('.')[0]; +} + /** Relative time for a DownloadInfo timestamp (nanoseconds). */ export function relativeTime(timestampNs: number): string { if (!timestampNs) return ''; diff --git a/ui/src/app/library-browser.component.html b/ui/src/app/library-browser.component.html index 711d743..3049441 100644 --- a/ui/src/app/library-browser.component.html +++ b/ui/src/app/library-browser.component.html @@ -49,6 +49,7 @@
{{ file.name }}
+ {{ siteLabel(file.meta?.website) }} {{ file.size | fileSize }} {{ fileTime(file) }}
@@ -76,10 +77,11 @@
{{ file.name }}
-
- {{ file.size | fileSize }} - {{ fileTime(file) }} -
+
+ {{ siteLabel(file.meta?.website) }} + {{ file.size | fileSize }} + {{ fileTime(file) }} +
diff --git a/ui/src/app/library-browser.component.sass b/ui/src/app/library-browser.component.sass index 543d2bd..3be4c49 100644 --- a/ui/src/app/library-browser.component.sass +++ b/ui/src/app/library-browser.component.sass @@ -247,6 +247,22 @@ color: var(--fg) font-family: var(--font-mono) +.lib-badge + font-size: 10.5px + font-weight: 550 + padding: 1px 7px + border-radius: 20px + border: 1px solid var(--border) + background: var(--bg) + color: var(--muted) + letter-spacing: 0.02em + white-space: nowrap + + &.site + color: var(--accent-strong) + background: var(--accent-tint) + border-color: oklch(85% 0.05 145) + .lib-actions display: flex gap: 2px diff --git a/ui/src/app/library-browser.component.ts b/ui/src/app/library-browser.component.ts index 5f7f350..56e863e 100644 --- a/ui/src/app/library-browser.component.ts +++ b/ui/src/app/library-browser.component.ts @@ -1,7 +1,7 @@ import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; import { faExternalLinkAlt, faList, faPlay, faRedoAlt, faThLarge, faTrashAlt } from '@fortawesome/free-solid-svg-icons'; import { DownloadsService, LibraryFile } from './downloads.service'; -import { relativeTime } from './labels'; +import { relativeTime, siteLabel } from './labels'; @Component({ selector: 'app-library-browser', @@ -35,6 +35,7 @@ export class LibraryBrowserComponent implements OnChanges { faTrashAlt = faTrashAlt; faRedoAlt = faRedoAlt; faExternalLinkAlt = faExternalLinkAlt; + siteLabel = siteLabel; constructor(public downloads: DownloadsService) {}