remove redundant thumbnail embed task

This commit is contained in:
Simon 2025-12-28 11:44:52 +07:00
parent 11638a2430
commit 7950dbb729
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
5 changed files with 2 additions and 43 deletions

View File

@ -80,13 +80,6 @@ THUMBNAIL_CHECK: TaskItemConfig = {
"api_stop": False, "api_stop": False,
} }
RESYNC_THUMBS: TaskItemConfig = {
"title": "Sync Thumbnails to Media Files",
"group": "setting:thumbnailsync",
"api_start": True,
"api_stop": False,
}
RESYNC_METADATA: TaskItemConfig = { RESYNC_METADATA: TaskItemConfig = {
"title": "Sync Metadata to Media Files", "title": "Sync Metadata to Media Files",
"group": "setting:thumbnailsync", "group": "setting:thumbnailsync",
@ -125,7 +118,6 @@ TASK_CONFIG: dict[str, TaskItemConfig] = {
"restore_backup": RESTORE_BACKUP, "restore_backup": RESTORE_BACKUP,
"rescan_filesystem": RESCAN_FILESYSTEM, "rescan_filesystem": RESCAN_FILESYSTEM,
"thumbnail_check": THUMBNAIL_CHECK, "thumbnail_check": THUMBNAIL_CHECK,
"resync_thumbs": RESYNC_THUMBS,
"resync_metadata": RESYNC_METADATA, "resync_metadata": RESYNC_METADATA,
"index_playlists": INDEX_PLAYLISTS, "index_playlists": INDEX_PLAYLISTS,
"subscribe_to": SUBSCRIBE_TO, "subscribe_to": SUBSCRIBE_TO,

View File

@ -19,7 +19,7 @@ from common.src.ta_redis import RedisArchivist
from common.src.urlparser import ParsedURLType, Parser from common.src.urlparser import ParsedURLType, Parser
from download.src.queue import PendingList from download.src.queue import PendingList
from download.src.subscriptions import SubscriptionHandler, SubscriptionScanner from download.src.subscriptions import SubscriptionHandler, SubscriptionScanner
from download.src.thumbnails import ThumbFilesystem, ThumbValidator from download.src.thumbnails import ThumbValidator
from download.src.yt_dlp_handler import VideoDownloader from download.src.yt_dlp_handler import VideoDownloader
from task.src.notify import Notifications from task.src.notify import Notifications
from task.src.task_config import TASK_CONFIG from task.src.task_config import TASK_CONFIG
@ -294,19 +294,6 @@ def thumbnail_check(self):
thumbnail.clean_up() thumbnail.clean_up()
@shared_task(bind=True, name="resync_thumbs", base=BaseTask)
def re_sync_thumbs(self):
"""sync thumbnails to mediafiles"""
manager = TaskManager()
if manager.is_pending(self):
print(f"[task][{self.name}] thumb re-embed is already running")
self.send_progress(["Thumbnail re-embed is already running."])
return
manager.init(self)
ThumbFilesystem(task=self).embed()
@shared_task(bind=True, name="resync_metadata", base=BaseTask) @shared_task(bind=True, name="resync_metadata", base=BaseTask)
def re_sync_metadata(self): def re_sync_metadata(self):
"""resync metadata to media files""" """resync metadata to media files"""

View File

@ -10,7 +10,6 @@ export type TaskScheduleNameType =
| 'restore_backup' | 'restore_backup'
| 'rescan_filesystem' | 'rescan_filesystem'
| 'thumbnail_check' | 'thumbnail_check'
| 'resync_thumbs'
| 'index_playlists' | 'index_playlists'
| 'subscribe_to' | 'subscribe_to'
| 'version_check'; | 'version_check';

View File

@ -1,6 +1,6 @@
import APIClient from '../../functions/APIClient'; import APIClient from '../../functions/APIClient';
type TaskNamesType = 'download_pending' | 'update_subscribed' | 'resync_thumbs' | 'resync_metadata'; type TaskNamesType = 'download_pending' | 'update_subscribed' | 'resync_metadata';
const updateTaskByName = async (taskName: TaskNamesType) => { const updateTaskByName = async (taskName: TaskNamesType) => {
return APIClient(`/api/task/by-name/${taskName}/`, { return APIClient(`/api/task/by-name/${taskName}/`, {

View File

@ -15,7 +15,6 @@ const SettingsActions = () => {
const [deleteIgnored, setDeleteIgnored] = useState(false); const [deleteIgnored, setDeleteIgnored] = useState(false);
const [deletePending, setDeletePending] = useState(false); const [deletePending, setDeletePending] = useState(false);
const [processingImports, setProcessingImports] = useState(false); const [processingImports, setProcessingImports] = useState(false);
const [reEmbed, setReEmbed] = useState(false);
const [reSyncMeta, setReSyncMeta] = useState(false); const [reSyncMeta, setReSyncMeta] = useState(false);
const [backupStarted, setBackupStarted] = useState(false); const [backupStarted, setBackupStarted] = useState(false);
const [isRestoringBackup, setIsRestoringBackup] = useState(false); const [isRestoringBackup, setIsRestoringBackup] = useState(false);
@ -51,7 +50,6 @@ const SettingsActions = () => {
deleteIgnored || deleteIgnored ||
deletePending || deletePending ||
processingImports || processingImports ||
reEmbed ||
reSyncMeta || reSyncMeta ||
backupStarted || backupStarted ||
isRestoringBackup || isRestoringBackup ||
@ -61,7 +59,6 @@ const SettingsActions = () => {
setDeleteIgnored(false); setDeleteIgnored(false);
setDeletePending(false); setDeletePending(false);
setProcessingImports(false); setProcessingImports(false);
setReEmbed(false);
setReSyncMeta(false); setReSyncMeta(false);
setBackupStarted(false); setBackupStarted(false);
setIsRestoringBackup(false); setIsRestoringBackup(false);
@ -118,22 +115,6 @@ const SettingsActions = () => {
)} )}
</div> </div>
</div> </div>
<div className="settings-group">
<h2>Embed thumbnails into media file.</h2>
<p>Set extracted youtube thumbnail as cover art of the media file.</p>
<div id="re-embed">
{reEmbed && <p>Processing thumbnails</p>}
{!reEmbed && (
<Button
label="Start process"
onClick={async () => {
await updateTaskByName('resync_thumbs');
setReEmbed(true);
}}
/>
)}
</div>
</div>
<div className="settings-group"> <div className="settings-group">
<h2>Embed metadata into media file</h2> <h2>Embed metadata into media file</h2>
<p>Embed metadata into media files as mp4 tags.</p> <p>Embed metadata into media files as mp4 tags.</p>