Add movie-keyed pool index with multi-version movies, ČSFD title bridge, subtitles and miniDLNA library scoping
This commit is contained in:
@@ -19,6 +19,7 @@ Example:
|
||||
"""
|
||||
import os
|
||||
import random
|
||||
import shutil
|
||||
from collections import defaultdict
|
||||
from pathlib import Path
|
||||
from typing import List, Tuple, Optional, Dict, Set
|
||||
@@ -341,6 +342,26 @@ class HardlinkManager:
|
||||
|
||||
return success_count, fail_count
|
||||
|
||||
def remove_mirror(self, name: str) -> bool:
|
||||
"""Remove ``output_dir/name`` entirely (file or folder tree).
|
||||
|
||||
Used to drop a whole mirrored library (or one entry of the shared
|
||||
mixed-library-series bucket) when it falls out of the miniDLNA
|
||||
generation's scope. Mirrors are pure hardlinks, so deleting the folder
|
||||
loses nothing — it's fully regenerable from the pool. ``name`` may
|
||||
contain "/" to address one entry inside a bucket folder.
|
||||
|
||||
Returns whether anything was actually removed.
|
||||
"""
|
||||
target = self.output_dir / name
|
||||
if not target.exists():
|
||||
return False
|
||||
if target.is_dir():
|
||||
shutil.rmtree(target)
|
||||
else:
|
||||
target.unlink()
|
||||
return True
|
||||
|
||||
def _fill_special_folder(
|
||||
self, chosen: List[File], subfolder: str, dry_run: bool
|
||||
) -> Tuple[int, int]:
|
||||
|
||||
Reference in New Issue
Block a user