FileGroups in Collections can be reorganized in the Collection's directory.

* Batch reorganization is supported for both Domain and Channel Collections.
* Batch reorganization happens when any Collection does not match the respective file format. For example, a Channel Collection file format that does not match the `yt_dlp_options.file_name_format` will show `needs_reorganization`.
* Individual Collections can always be reorganized. The reorganization is a little more aggressive. Useful for when some files may have been missed in the batch reorganization.
This commit is contained in:
Roland 2026-01-23 19:51:02 -07:00
parent 208ac4fac7
commit 74cb5171da
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
49 changed files with 6614 additions and 181 deletions

View file

@ -2,6 +2,7 @@ import React, {useState} from "react";
import {Grid, StatisticLabel, StatisticValue,} from "semantic-ui-react";
import {createChannel, deleteChannel, refreshChannel, tagChannel, tagChannelInfo} from "../api";
import {CollectionTagModal} from "./collections/CollectionTagModal";
import {CollectionReorganizeModal} from "./collections/CollectionReorganizeModal";
import {
APIButton,
BackButton,
@ -88,6 +89,7 @@ export function ChannelEditPage() {
const [tagEditModalOpen, setTagEditModalOpen] = useState(false);
const [downloadModalOpen, setDownloadModalOpen] = useState(false);
const [reorganizeModalOpen, setReorganizeModalOpen] = useState(false);
const {channel, form, fetchChannel} = useChannel(channelId);
@ -192,10 +194,21 @@ export function ChannelEditPage() {
style={{marginTop: '1em'}}
>Tag</Button>;
const reorganizeButton = (
<APIButton
color='orange'
size='small'
onClick={() => setReorganizeModalOpen(true)}
obeyWROLMode={true}
style={{marginTop: '1em'}}
>Reorganize Files</APIButton>
);
const actionButtons = <>
{deleteButton}
{refreshButton}
{tagButton}
{reorganizeButton}
</>;
const downloadMissingDataInfo = 'Automatically download missing comments, etc, in the background.';
@ -207,6 +220,16 @@ export function ChannelEditPage() {
<Button>Videos</Button>
</Link>
{channel?.needs_reorganization && (
<Message warning>
<Message.Header>File Format Changed</Message.Header>
<p>
The file name format has changed. Click "Reorganize Files" to move existing files
to match the new format.
</p>
</Message>
)}
<CollectionEditForm
form={form}
title="Edit Channel"
@ -279,6 +302,16 @@ export function ChannelEditPage() {
hasDirectory={!!channel.directory}
/>
{/* Reorganize Modal */}
<CollectionReorganizeModal
open={reorganizeModalOpen}
onClose={() => setReorganizeModalOpen(false)}
collectionId={channel?.collection_id}
collectionName={channel?.name}
onComplete={fetchChannel}
needsReorganization={channel?.needs_reorganization}
/>
{/* Downloads Segment */}
<Segment>
<Grid columns={2}>