View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 5 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Aug 05, 2007 11:27 am 
Offline
Joined: Thu Aug 02, 2007 5:16 pm
Posts: 57
So, I'm loading up my machine with .vob files.

After awhile, I decide I want to create folders to organize them. I originally dumped everything into the main /myth/video and added data from IMDB in Video Manager.

/myth/video/

Now, I created some folders in /myth/video - for this post, let's just say I did it by year.

/myth/video/1982
/myth/video/1983

etc. etc.

Now, if I just do a simple command like...

mv /myth/video/foo.vob /myth/video/1982/.

I blow out the metadata and have to re-enter it in Video Manager.

I'd be more than willing to write a script to handle this - but where is the metadata stored, and how is it tied to a specific .vob path and file?

Anyone have any knowledge on this?

I'm expecting that I'll be moving folders around a lot for ease of navigation, and I'm probably not the only person with a desire to do so. I think this would be a useful script.

I'll post any script I write.

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 5:41 pm 
Offline
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location: Farmington, MI USA
I'm still running R5D1 so the tables may have changed, but most of the data for videos is stored in videometadata. Try
Code:
mysql mythconverg <<EOF
show tables;
quit
EOF
for other possibilities.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 13, 2007 10:27 pm 
Offline
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location: California
I'm on R5D1. The table you want is called "videometadata" in R5D1 and the column you need to update is called "filename".

Marc


Top
 Profile  
 
PostPosted: Wed Oct 10, 2007 6:08 pm 
Offline
Joined: Thu Aug 02, 2007 5:16 pm
Posts: 57
I created a short shell script to parse a flat file and add a plot summary into Video Manager via a MySQL command.

The flat file is just a normal text file that contains the following information in this format...

Bloody Body in Vegas:27 May 2003:A small amount of DNA evidence left at the scene allows the CSI team to track down the assailant

Note that this is all on one-line!!! For popular TV shows, you can find episode summaries on-line. In VI, you can use the J command to join text onto a single line. Useful tip for creating this metadatafile.

I also list my video files in the following naming convention...

01-video-filename
02-video-filename
03-video-filename

That's why I have the command [0-9][0-9] in my ls command below.

This controls the order of the files in VideoManager. The videos are in the same order in the flat file.

Then, run this script as a user with permission to edit your MySQL table that stores your VideoManager data.

Code:
#!/bin/bash
videodir="/myth/video/sub-directory"
let "episodenum=1"
metadatafile=flat_file_with_your_metadata.mtd

ls ${videodir}/[0-9][0-9]* | while read videofile; do
    echo ${episodenum}
    episode_summary=$(head -n${episodenum} ${metadatafile} | tail -n1)

    if [ ${episodenum} -lt 10 ]; then
    two_digit_episode_num='0'${episodenum}
    else
    two_digit_episode_num=${episodenum}
    fi

    title=${two_digit_episode_num}'-'$(echo ${episode_summary} | cut -f1 -d":");
    airdate=$(echo ${episode_summary} | cut -f2 -d":" | cut -f3 -d " ");
    plot_summary=$(echo ${episode_summary} | cut -f3 -d":" | sed "s/'/\\\'/g")

    echo ${videofile}
    echo ${title}
    echo ${airdate}
    echo ${plot_summary}

    dataexists=$(mysql --skip-column-names -B -p$password -e "use mythconverg; select filename from videometadata where filename='${videofile}';")
    if [ ! -n "$dataexists" ]
    then
        echo "Metadata does not exist for ${title}"
    else
        echo "Metadata found for ${title}!  Updating!"
        mysql -p$password -e "use mythconverg; UPDATE videometadata SET title='${title}',plot='${plot_summary}',year='${airdate}' where filename='${videofile}';"
    fi
    let "episodenum++"
done
[/code]


Last edited by mooseboots on Sun Oct 14, 2007 4:54 pm, edited 1 time in total.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 12, 2007 4:42 pm 
Offline
Joined: Tue Mar 22, 2005 9:18 pm
Posts: 1422
Location: Brisbane, Queensland, Australia
mooseboots, could you edit your post and put your code in a "code" section just makes it much easier to read and then you also know what to copy and paste exactly.

_________________
Girkers


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu