Add auto-move option on metadata update and simplify file monitoring (#1137)

- Introduce option to automatically move books when their metadata is updated
- Simplify the file monitoring workflow for improved reliability and clarity
This commit is contained in:
Aditya Chandel
2025-09-12 11:59:36 -06:00
committed by GitHub
parent 7adc2b3f57
commit 6ea2eb58bc
47 changed files with 3749 additions and 2942 deletions
@@ -4,5 +4,7 @@
}
.live-border {
border: 0.5px solid var(--primary-color);
background: var(--card-background);
border: 1px solid var(--primary-color);
border-radius: 0.5rem;
}
@@ -1,3 +1,5 @@
.live-border {
border: 0.5px solid var(--primary-color);
background: var(--card-background);
border: 1px solid var(--primary-color);
border-radius: 0.5rem;
}
@@ -1,4 +1,7 @@
.live-border {
border: 0.5px solid var(--primary-color);
background: var(--card-background);
border: 1px solid var(--primary-color);
border-radius: 0.5rem;
}
@@ -81,6 +81,7 @@ export interface Douban {
}
export interface MetadataPersistenceSettings {
moveFilesToLibraryPattern: boolean;
saveToOriginalFile: boolean;
convertCbrCb7ToCbz: boolean;
backupMetadata: boolean;
@@ -25,12 +25,13 @@
position: absolute;
top: -0.4rem;
right: -0.4rem;
background-color: var(--red-500);
color: yellowgreen;
padding: 0 8px;
font-size: 1rem;
font-weight: 400;
line-height: 1.2;
background-color: red;
color: white;
border-radius: 50%;
width: 1.2rem;
height: 1.2rem;
font-size: 0.75rem;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
@@ -237,8 +237,8 @@ export class AppTopBarComponent implements OnDestroy {
get iconColor(): string {
if (this.progressHighlight) return 'yellow';
if (this.showPulse) return 'red';
if (this.completedTaskCount > 0 || this.hasPendingBookdropFiles || this.hasDuplicateFiles) return 'orange';
if (this.showPulse) return 'orange';
if (this.completedTaskCount > 0 || this.hasPendingBookdropFiles || this.hasDuplicateFiles) return 'yellowgreen';
return 'inherit';
}
@@ -5,7 +5,7 @@
File Naming Patterns
</h2>
<p class="settings-description">
Define custom naming patterns for uploaded files and for moving files within your library. Use metadata placeholders to automate organization.
Configure automatic file organization using metadata placeholders. Patterns are applied when uploading files, moving files within your library, and after metadata updates.
</p>
</div>
@@ -17,7 +17,7 @@
Default File Naming Pattern
</h3>
<p class="section-description">
Define the default naming pattern for files. This pattern applies to all libraries unless overridden.
This pattern serves as the fallback when no library-specific override is configured.
</p>
</div>
@@ -7,6 +7,13 @@
</div>
<div class="settings-card">
<div class="warning-notice">
<i class="pi pi-exclamation-triangle"></i>
<div>
<strong>Network Storage Notice:</strong> These features are designed for local file systems and have not been tested with network storage (NAS/cloud). Functionality cannot be guaranteed on network file systems.
</div>
</div>
<div class="setting-item">
<div class="setting-info">
<div class="setting-label-row">
@@ -23,7 +30,7 @@
</div>
</div>
<div class="setting-item">
<div class="setting-item setting-item-indented">
<div class="setting-info">
<div class="setting-label-row">
<label class="setting-label">Convert CBR/CB7 to CBZ</label>
@@ -40,7 +47,7 @@
</div>
</div>
<div class="setting-item">
<div class="setting-item setting-item-indented">
<div class="setting-info">
<div class="setting-label-row">
<label class="setting-label">Backup Metadata</label>
@@ -57,7 +64,7 @@
</div>
</div>
<div class="setting-item">
<div class="setting-item setting-item-indented">
<div class="setting-info">
<div class="setting-label-row">
<label class="setting-label">Backup Cover</label>
@@ -73,5 +80,21 @@
</p>
</div>
</div>
<div class="setting-item">
<div class="setting-info">
<div class="setting-label-row">
<label class="setting-label">Auto-Move Files on Metadata Update</label>
<p-toggleswitch
[ngModel]="metadataPersistence.moveFilesToLibraryPattern"
(onChange)="onPersistenceToggle('moveFilesToLibraryPattern')">
</p-toggleswitch>
</div>
<p class="setting-description">
<i class="pi pi-info-circle"></i>
Automatically move and rename files according to their library's naming pattern when metadata is updated, either through manual editing or auto-fetch operations.
</p>
</div>
</div>
</div>
</div>
@@ -46,9 +46,32 @@
padding-bottom: 0;
}
&.setting-item-indented {
margin-left: 1.5rem;
padding-left: 1rem;
border-left: 2px solid var(--p-content-border-color);
position: relative;
&::before {
content: '';
position: absolute;
left: -2px;
top: 0;
bottom: 0;
width: 2px;
background: var(--p-primary-color);
opacity: 0.3;
}
}
@media (max-width: 768px) {
flex-direction: column;
gap: 1rem;
&.setting-item-indented {
margin-left: 1rem;
padding-left: 0.75rem;
}
}
}
@@ -113,3 +136,23 @@
width: 100%;
}
}
.warning-notice {
display: flex;
align-items: flex-start;
gap: 0.5rem;
color: var(--p-red-400);
font-size: 0.875rem;
line-height: 1.5;
.pi-exclamation-triangle {
color: var(--p-red-500);
margin-top: 0.125rem;
flex-shrink: 0;
}
strong {
font-weight: 600;
color: var(--p-red-500);
}
}
@@ -21,6 +21,7 @@ export class MetadataPersistenceSettingsComponent implements OnInit {
metadataPersistence: MetadataPersistenceSettings = {
saveToOriginalFile: false,
convertCbrCb7ToCbz: false,
moveFilesToLibraryPattern: false,
backupMetadata: true,
backupCover: true
};