[Titanic]_[YYYYMMDD]_[Source]_[Type]_[Language]_[Resolution]_[Version].[ext] | Placeholder | Example | Explanation | |-------------|---------|-------------| | | Titanic | Fixed project identifier | | YYYYMMDD | 1997-12-19 → 19971219 | Original release or recording date | | Source | BBC , IMAX , NationalArchive | Origin of the material | | Type | Doc , Feature , Audio , Clip | Broad content category | | Language | EN , DE , FR | ISO‑639‑1 language code | | Resolution | 1080p , 720p , N/A | Video resolution; “N/A” for audio only | | Version | v01 , v02 | Increment when you edit or re‑encode | | ext | mp4 , avi , wma , aac | Container / codec | Aomei Partition Assistant Serial Key — Optimize Disk Space
cur = conn.cursor() cur.execute(''' INSERT INTO titanic_media ( filename, filepath, size_bytes, md5, format, title, creator, language, release_date, resolution, version, last_modified, tags, notes ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?) ''', ( os.path.basename(path), rel, stat.st_size, md5(path), fmt, audio.get('title',[None])[0], audio.get('artist',[None])[0], audio.get('language',[None])[0], audio.get('date',[None])[0], None, # resolution (populate manually for video) None, # version (parse from filename if needed) datetime.datetime.fromtimestamp(stat.st_mtime), ','.join(audio.tags.keys()) if audio else None, None # notes )) conn.commit() Keith Jarrett - The Koln Concert-flac Ita--tnt ... ✓
# 2️⃣ For each file, pull the *creation* date from metadata, fallback to filename date while IFS= read -r f; do # Try to read creation_time from container metadata ct=$(ffprobe -v error -show_entries format_tags=creation_time -of default=noprint_wrappers=1:nokey=1 "$f") if [[ -z "$ct" ]]; then # Extract date from filename (assumes YYYYMMDD pattern) ct=$(basename "$f" | grep -oP '\d8' | head -1) ct="$ct:0:4-$ct:4:2-$ct:6:2" fi # If we have a date, apply it as the file's last-modified timestamp if [[ -n "$ct" ]]; then touch -d "$ct" "$f" echo "✔︎ $f → $ct" else echo "⚠︎ $f → no date found" fi done < /tmp/titanic_files.txt Tip: Run this after any bulk import to lock the timestamps in place. | Format | Tool | Key Tags to Add | |--------|------|-----------------| | MP4 / MOV | ffmpeg -i input.mp4 -metadata title="Titanic – The Lost Footage" -metadata artist="James Cameron" -metadata comment="Restored 2023" output.mp4 | title , artist , album , genre , date , comment | | AVI | exiftool -Title="Titanic – Survivor Testimony" -Author="National Archives" file.avi | Title , Author , Comment , CreationDate | | WMA / AAC | mutagen (Python) or id3v2 ‑style tools | title , artist , album , date , genre , description |
def md5(path): h = hashlib.md5() with open(path, 'rb') as f: for chunk in iter(lambda: f.read(8192), b''): h.update(chunk) return h.hexdigest()