File Rename Tagging the not found ones
2 posters
Page 1 of 1
File Rename Tagging the not found ones
Hi,
I recently managed to get my head around a combination of comictagger, bash script and launchd daemon that automagically tags my comics when left on a certain folder. But found a problem when the comic is not yet recogniced and can't be correctly tagged/renamed.
Would it be possible to add an option like "--tag-failures" that simply added a prefix/suffix to the comic file so it's easier to know when a tagging run left some of them untagged?
Example:
somecomic.cbr
ComicTagger -s -t cbl -o -f somecomic.cbr
Comic processed, let's rename it
ComicTagger -r --tag-failures comecomic.cbr
if the tagging was successfull the resulting file would be
somecomic #001 (2014).cbr
If failed to tag, the resulting file would be:
FAIL_somecomic.cbr
or
somecomic -FAIL.cbr
or even a selectable suffix/prefix like the -t option
Is it possible?
I recently managed to get my head around a combination of comictagger, bash script and launchd daemon that automagically tags my comics when left on a certain folder. But found a problem when the comic is not yet recogniced and can't be correctly tagged/renamed.
Would it be possible to add an option like "--tag-failures" that simply added a prefix/suffix to the comic file so it's easier to know when a tagging run left some of them untagged?
Example:
somecomic.cbr
ComicTagger -s -t cbl -o -f somecomic.cbr
Comic processed, let's rename it
ComicTagger -r --tag-failures comecomic.cbr
if the tagging was successfull the resulting file would be
somecomic #001 (2014).cbr
If failed to tag, the resulting file would be:
FAIL_somecomic.cbr
or
somecomic -FAIL.cbr
or even a selectable suffix/prefix like the -t option
Is it possible?
shadowcharly- Posts : 3
Join date : 2014-02-12
Re: File Rename Tagging the not found ones
You can use a little shell scripting to accomplish this using the exisiting ComicTagger options.
will give you a list of one-line summaries of page counts and tag types in each comic. (Use the '-R' option to recursively scan all sub-folders)
will give a list of all comic files that don't have tags.
We can put this into a shell script to get what you want:
- Code:
comictagger.py -p --terse *
will give you a list of one-line summaries of page counts and tag types in each comic. (Use the '-R' option to recursively scan all sub-folders)
- Code:
comictagger.py -p --terse * |grep "\[ none \]"|cut -f1 -d:
will give a list of all comic files that don't have tags.
We can put this into a shell script to get what you want:
- Code:
#!/bin/bash
# A small script to rename untagged comic files
COMICTAGGER="/Applications/ComicTagger.app/Contents/MacOS/ComicTagger"
# Set the field separator to new line
IFS=$'\n'
# get a list of untagged comics
# (Use the '-R' option to recursively scan all sub-folders)
UNTAGGED=`$COMICTAGGER -p --terse * |grep "\[ none \]"|cut -f1 -d:`
for i in $UNTAGGED
do
if [[ $i == *\(UNTAGGED\)* ]]
then
echo "$i: No need to rename";
else
NEWNAME="${i%.*} (UNTAGGED).${i##*.}"
mv $i $NEWNAME
echo "\"$i\": renamed to " \"$NEWNAME\"
fi
done
Yay!
Thank you very much!
Combined with a nice
UNTAGGED=`find $WORKDIR -name "*\(UNTAGGED\)*" -print`
And some mumbo jumbo, i can now determine if all the comics were successfully tagged and move them accordingly to their destination folder.
Didn't knew about the -p --terse option, you have it thoroughly thought about
Very nice tool, hoping the comic vine database comes back from the abyss soon.
Combined with a nice
UNTAGGED=`find $WORKDIR -name "*\(UNTAGGED\)*" -print`
And some mumbo jumbo, i can now determine if all the comics were successfully tagged and move them accordingly to their destination folder.
Didn't knew about the -p --terse option, you have it thoroughly thought about
Very nice tool, hoping the comic vine database comes back from the abyss soon.
shadowcharly- Posts : 3
Join date : 2014-02-12
Similar topics
» rename without tagging
» File Rename...
» File Rename Questions
» Ignore quotation marks in File rename
» File rename - 2 suggestions only matched data, history
» File Rename...
» File Rename Questions
» Ignore quotation marks in File rename
» File rename - 2 suggestions only matched data, history
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum