Skip to content

Instantly share code, notes, and snippets.

@mperlet
Created August 18, 2015 13:38
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mperlet/000001d5a571a5aa8045 to your computer and use it in GitHub Desktop.
Save mperlet/000001d5a571a5aa8045 to your computer and use it in GitHub Desktop.
Problem: minidlna use the title from the metadata, sometimes its better when the title = the filename. This script change the title from "'HERE THE NONE UNIQUE TITLE'" to the filename.
for line in $(sqlite3 /root/minidlna/files.db "SELECT ID,PATH FROM DETAILS WHERE TITLE='HERE THE NONE UNIQUE TITLE';");
do
id=$(echo $line | cut -d"|" -f1);
path=$(echo $line | cut -d"|" -f2);
echo $id;
echo $path;
sqlite3 /root/minidlna/files.db "UPDATE DETAILS SET TITLE='$(basename $path)' WHERE ID=$id;";
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment