[mythtv-users] Bulk change of video metadata?

Jack McGee jack at greendesk.net
Wed Feb 8 00:13:33 UTC 2012


On 3/5/2010 12:06 PM, mythtv at blandford.net wrote:
> On 03/05/2010 11:01 AM, Jack McGee wrote:
>> I installed a new frontend and don't know what I did but it blew out the
>> video data. The list was empty, I had to rescan.
>>
>> Really, the only metadata I lost was parental level, most were set to 4.
>>
>> I guess there are three ways to fix this:
>>
>> 1) go through Video Manager and change metadata one by one.
>> 2) run some command through PHPMYADMIN or sql command line.
>> 3) partial restore from a backup.
>>
>> I'm inclined to do #2, there are many videos.
>> Can anyone point me to a command that will change all of them to level
>> 4, and I can change whatever needs to be back to 1.
>
>
> Hi Jack,
>
> I keep my files in seperate directories and use this script.  Just 
> change the update_dir path in the last couple lines.
>
> Michael
>
>
> #!
> # Source mysql.txt to find out db information
> if [ -f $HOME/.mythtv/mysql.txt ]; then
>         . $HOME/.mythtv/mysql.txt
> else
>         echo "Couldn't locate mysql.txt"
>         exit 1
> fi
>
> function update_dir {
>         RATED_DIR="$1"
>         SHOWLEVEL="$2"
>         if [ ! -d "$RATED_DIR" ]; then
>                 echo "No such directory: $RATED_DIR"
>                 exit 1
>         fi
>         echo "UPDATE  videometadata SET showlevel=$SHOWLEVEL  WHERE 
> filename LIKE '$RATED_DIR/%' ;" | mysql -u $DBUserName 
> --password=$DBPassword -D $DBName -h $DBHostName
> }
>
> update_dir "/mythtv/video/Movies" 4
> update_dir "/mythtv/video/KidShows" 1
>
> _______________________________________________

For some unknown reason, all my video metadata was blown out again.  
Still just want to change parental levels.  I tried to run above script 
again , but it doesn't seem to have done anything.  Will it still work 
with current .24 version?

And anyone know why this metadata get's blown out? I rarely use Mythweb, 
that was not it.
It only showed files in Level 1 directory, nothing showed up on 4,  I 
rescanned, and everything that was level 4 is now level 1 I guess by 
default.




More information about the mythtv-users mailing list