Compare commits
4 Commits
6fd0c6e7f6
...
d29639a9c5
| Author | SHA1 | Date |
|---|---|---|
|
|
d29639a9c5 | |
|
|
bb642b29f2 | |
|
|
3fafb98651 | |
|
|
326c66f0e2 |
|
|
@ -47,8 +47,8 @@ guide to switching back to the official build once the upstream fix lands.
|
||||||
./build-ytdlp.sh
|
./build-ytdlp.sh
|
||||||
|
|
||||||
docker buildx build --platform linux/amd64 \
|
docker buildx build --platform linux/amd64 \
|
||||||
--build-arg VERSION=1.25 \
|
--build-arg VERSION=1.26 \
|
||||||
-t 192.168.2.212:3000/tigeren/metube:1.25 \
|
-t 192.168.2.212:3000/tigeren/metube:1.26 \
|
||||||
--push .
|
--push .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -867,7 +867,12 @@ class DownloadQueue:
|
||||||
key = entry.get('webpage_url') or entry['url']
|
key = entry.get('webpage_url') or entry['url']
|
||||||
if not self.queue.exists(key):
|
if not self.queue.exists(key):
|
||||||
dl = DownloadInfo(video_id, entry.get('title') or video_id, key, quality, format, folder, custom_name_prefix, error, entry, playlist_item_limit)
|
dl = DownloadInfo(video_id, entry.get('title') or video_id, key, quality, format, folder, custom_name_prefix, error, entry, playlist_item_limit)
|
||||||
await self.__add_download(dl, auto_start)
|
result = await self.__add_download(dl, auto_start)
|
||||||
|
if result:
|
||||||
|
# __add_download reports a skipped duplicate or an error
|
||||||
|
# (e.g. {'status': 'ok', 'msg': 'Download already exists'});
|
||||||
|
# surface that instead of an unconditional success.
|
||||||
|
return result
|
||||||
return {'status': 'ok'}
|
return {'status': 'ok'}
|
||||||
return {'status': 'error', 'msg': f'Unsupported resource "{etype}"'}
|
return {'status': 'error', 'msg': f'Unsupported resource "{etype}"'}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, HostListener, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Observable, distinctUntilChanged, map } from 'rxjs';
|
import { Observable, distinctUntilChanged, map } from 'rxjs';
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@ export type DownloadTab = 'downloading' | 'queued' | 'completed';
|
||||||
styleUrls: ['./app.component.sass'],
|
styleUrls: ['./app.component.sass'],
|
||||||
standalone: false
|
standalone: false
|
||||||
})
|
})
|
||||||
export class AppComponent implements OnInit {
|
export class AppComponent implements OnInit, OnDestroy {
|
||||||
formats: Format[] = Formats;
|
formats: Format[] = Formats;
|
||||||
qualities: Quality[];
|
qualities: Quality[];
|
||||||
themes: Theme[] = Themes;
|
themes: Theme[] = Themes;
|
||||||
|
|
@ -128,6 +128,15 @@ export class AppComponent implements OnInit {
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
|
||||||
if (this.activeTheme.id === 'auto') this.setTheme(this.activeTheme);
|
if (this.activeTheme.id === 'auto') this.setTheme(this.activeTheme);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Listen in the capture phase so Escape closes the player even when the
|
||||||
|
// native video controls (shadow DOM) hold focus after seeking and would
|
||||||
|
// otherwise swallow the keydown before it bubbles to the document.
|
||||||
|
document.addEventListener('keydown', this.onPlayerKeydown, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy(): void {
|
||||||
|
document.removeEventListener('keydown', this.onPlayerKeydown, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- Navigation ----------
|
// ---------- Navigation ----------
|
||||||
|
|
@ -169,10 +178,11 @@ export class AppComponent implements OnInit {
|
||||||
this.playerTitle = '';
|
this.playerTitle = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@HostListener('document:keydown.escape')
|
private onPlayerKeydown = (event: KeyboardEvent): void => {
|
||||||
onEscape(): void {
|
if (event.key === 'Escape' && this.playerUrl) {
|
||||||
if (this.playerUrl) this.closePlayer();
|
this.closePlayer();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// ---------- Library (媒体库) ----------
|
// ---------- Library (媒体库) ----------
|
||||||
|
|
||||||
|
|
@ -446,6 +456,11 @@ export class AppComponent implements OnInit {
|
||||||
this.addInProgress = false;
|
this.addInProgress = false;
|
||||||
if (status.status === 'error') {
|
if (status.status === 'error') {
|
||||||
this.toastService.show(`添加失败: ${status.msg}`, { error: true });
|
this.toastService.show(`添加失败: ${status.msg}`, { error: true });
|
||||||
|
} else if (status.msg) {
|
||||||
|
// Backend skipped the URL (e.g. "Download already exists") — surface
|
||||||
|
// that instead of a misleading "added to queue".
|
||||||
|
this.toastService.show(status.msg, { error: true });
|
||||||
|
this.loadEvents();
|
||||||
} else {
|
} else {
|
||||||
this.addUrl = '';
|
this.addUrl = '';
|
||||||
this.toastService.show('已加入队列');
|
this.toastService.show('已加入队列');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue