mirror of
https://github.com/9001/copyparty.git
synced 2025-10-05 02:39:38 +02:00
prevent dupe tags from mtp (replace id3 tags)
This commit is contained in:
parent
90c5f2b9d2
commit
a83d3f8801
2 changed files with 21 additions and 0 deletions
|
@ -67,6 +67,17 @@ wget -S --header='Accept-Encoding: gzip' -U 'MSIE 6.0; SV1' http://127.0.0.1:392
|
|||
shab64() { sp=$1; f="$2"; v=0; sz=$(stat -c%s "$f"); while true; do w=$((v+sp*1024*1024)); printf $(tail -c +$((v+1)) "$f" | head -c $((w-v)) | sha512sum | cut -c-64 | sed -r 's/ .*//;s/(..)/\\x\1/g') | base64 -w0 | cut -c-43 | tr '+/' '-_'; v=$w; [ $v -lt $sz ] || break; done; }
|
||||
|
||||
|
||||
##
|
||||
## sqlite3 stuff
|
||||
|
||||
# find dupe metadata keys
|
||||
sqlite3 up2k.db 'select mt1.w, mt1.k, mt1.v, mt2.v from mt mt1 inner join mt mt2 on mt1.w = mt2.w where mt1.k = mt2.k and mt1.rowid != mt2.rowid'
|
||||
|
||||
# partial reindex by deleting all tags for a list of files
|
||||
sqlite3 up2k.db 'select mt1.w from mt mt1 inner join mt mt2 on mt1.w = mt2.w where mt1.k = mt2.k and mt1.rowid != mt2.rowid' > warks
|
||||
cat warks | while IFS= read -r x; do sqlite3 up2k.db "delete from mt where w = '$x'"; done
|
||||
|
||||
|
||||
##
|
||||
## vscode
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue