Can DVDpedia tag .m4v files with iTunes meta data?

Any trouble you encounter with the Pedias, here's the place to ask for help.
Post Reply
rael
Junior Member
Junior Member
Posts: 2
Joined: Tue Oct 13, 2009 7:00 pm

Can DVDpedia tag .m4v files with iTunes meta data?

Post by rael »

I'm new to the forum and have been searching for the for the answer to the above. DVDpedia is a really nice app for cataloging your DVD collection. It would be a great front end for tagging the iTunes meta data in .m4v/.mp4 files. I know there are several apps out there based on AtomicParsley that can do this, but none have as nice as an interface and iSight scanning capabilities as DVDpedia IMO. I'm also having difficulties with them corrupting my files. Does anyone have a plugin for this? Any thoughts of adding this?
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by Conor »

We hadn't thought about sending data back to the iTunes or its' files. Thank you for the suggestion. Not sure if we will implement this directly into DVDpedia as it looks like it would need a lot of testing. A quick look at AtomicParsley project shows that hasn't been updated in 3 years and only saw 9 months of developing activity; it could be a sign of a dead project or a testament of how stable it is. I will have to investigate further. A plug-in would be quite possible for an enthusiastic coder using NSTask to send information directly to AtomicParsley as you would use it via the command line.
User avatar
sjk
Addicted to Bruji
Addicted to Bruji
Posts: 529
Joined: Sat Feb 21, 2009 9:01 pm
Location: Eugene

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by sjk »

As an alternative to the problematic AtomicParsley and its projects, there was a recent suggestion on Elgato's forum to use Subler for tagging.
rael
Junior Member
Junior Member
Posts: 2
Joined: Tue Oct 13, 2009 7:00 pm

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by rael »

The tagging app I'm currently using is MetaX. Didn't realize this until now that it uses the barcode scanning source from Bruji, although it doesn't seem to work for looking up the content from Amazon & others like DVDpedia does. I don't know if the lookup engine is part of Bruji's scanning source. It just scans and finds the barcode, but never does anything (i.e. lookup) with the UPC number.

MetaX has also claimed to have modified the AtomicParsely source. http://www.kerstetter.net/index.php/pro ... ware/metax.

I realize that each app has it's specialty (i.e. tagging and cataloging) but it would be nice to have both in one app.
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by Conor »

We provide just the iSight capture and barcode deduction code. For the Amazon lookup they most write their own. It's based on XML and HTTP and can be easily put together with the Apple provided frameworks. Amazon made it slightly harder now with the authentication signature requirement but that is also out there on the web. Thank you for the tip about a modified version of the AtomicParsely.
williedigital
Captain
Captain
Posts: 20
Joined: Sun Nov 13, 2005 3:44 am

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by williedigital »

Conor,

Have you had a chance to look into this more? It would be a #1 desired feature for me to not have to find info/covers/etc. in two programs (dvdpedia and metaX) and have the whole shebang built into dvdpedia. Hell, I'd be willing to put up some side $$ to see this implemented just for the time savings it would provide me. As more and more people move to files rather than actual media, seems like a natural progression. Or per, Conor's earlier suggestion, any "enthusiastic coders" out there?
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by Conor »

I haven't yet taken a look at MetaX and possible integration, but it's on my to do list. Holidays are always the busiest times.
williedigital
Captain
Captain
Posts: 20
Joined: Sun Nov 13, 2005 3:44 am

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by williedigital »

Awesome news! Happy holidays.
williedigital
Captain
Captain
Posts: 20
Joined: Sun Nov 13, 2005 3:44 am

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by williedigital »

Just wanted to check and see if this is still on the list :mrgreen:
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by Conor »

Been working on other features since the Pocketpedia situation, so I haven't given MetaX a thorough look to find out if it would be possible to integrate it into the Pedias.
deadwulfe
Inductee
Inductee
Posts: 1
Joined: Mon Apr 05, 2010 8:55 am

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by deadwulfe »

I just wanted to add that I'm also interested in this feature.

I bought DVDpedia to catalog my ripped movies. Recently I purchased an AppleTV and have been looking for a way to automate tagging all of those movies in iTunes. The thought of redoing all of the work I did with DVDpedia makes me sad :cry:
jgr3g
Inductee
Inductee
Posts: 1
Joined: Sun Feb 12, 2012 8:24 pm

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by jgr3g »

Is this still in the works? Or am I praying to the wrong God?
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by Conor »

The QuickTime API access to .m4v metadata is really complicated to use at the moment. I did attempt it, but are waiting for an updated API from Apple plus needs cleaning up for 64-bit. It's in a half stage at the moment, can't say if it will materialize as a full feature. But I will keep you posted when I know more.
DriverJC
Bruji Friend
Bruji Friend
Posts: 16
Joined: Mon Aug 02, 2010 9:00 pm

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by DriverJC »

At the moment I use DVDPedia to provide the Tags for my MP4 Files that I have in my iTunes Library and SublerCLI to write the tags prior to import into iTunes.

I use a Bash script to do everything and it will run on every file in the folder selected.

I'm pasting my bash script below. This works great however you will need to modify the script to format the information the way you want, as I have it set to tag all movies as <Series> #<Series Index>: <Sub title> (for example, "Star Trek The Motion Picture" is tagged as "Star Trek #01: Star Trek the Motion Picture". feel free to modify as you see fit.

Code: Select all

OLDIFS=$IFS
IFS=$'\n'
appdirectory="/Users/joel/Movies/_Movies & TV Shows/0-Applications"
databasedump="/Users/joel/Documents/database.txt"
tempfiles="/Users/joel/Movies/_Movies & TV Shows/0-Temp Files"

# Check to see if a tagging session is in progress
if [ -e "$tempfiles/taggingvideo.flag" ]
	then
		echo Tagging Session in process!
		exit
else
		touch "$tempfiles/taggingVideo.flag"
fi

# Dump the database
echo "*********Dumping Database to $databasedump file"
# Version 5.0
sqlite3 /Users/joel/Library/Application\ Support/DVDpedia/Database.dvdpd '.dump ZENTRY'  | sed s/\'\,\'/\|/g | sed s/\'\,/\|/g | sed s/\,\'/\|/g | sed s/"CREATE TABLE ZENTRY ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZCUSTOMCHECKBOX1 INTAlbumEGER, ZCUSTOMCHECKBOX2 INTEGER, ZDOGTAG INTEGER, ZHASBEENSOLD INTEGER, ZHASMOVIELINK INTEGER, ZMYRATING INTEGER, ZONSALE INTEGER, ZSTATUS INTEGER, ZUID INTEGER, ZUPLOADED INTEGER, ZEPISODE INTEGER, ZSEASON INTEGER, ZBORROWEDON TIMESTAMP, ZCUSTOMDATE1 TIMESTAMP, ZCUSTOMDATE2 TIMESTAMP, ZDATEADDED TIMESTAMP, ZDATEEDITED TIMESTAMP, ZDUEDATE TIMESTAMP, ZPURCHASEDON TIMESTAMP, ZRELEASEDATE TIMESTAMP, ZSOLDON TIMESTAMP, ZLASTSEEN TIMESTAMP, ZTHEATRICAL TIMESTAMP, ZADDRESSBOOKID VARCHAR, ZASIN VARCHAR, ZASKINGPRICE VARCHAR, ZAWARDS VARCHAR, ZBORROWEDBY VARCHAR, ZBUYERADDRESS VARCHAR, ZBUYEREMAIL VARCHAR, ZBUYERNAME VARCHAR, ZCOLLECTIONID VARCHAR, ZCOMMENTS VARCHAR, ZCONDITION VARCHAR, ZCUSTOM1 VARCHAR, ZCUSTOM10 VARCHAR, ZCUSTOM2 VARCHAR, ZCUSTOM3 VARCHAR, ZCUSTOM4 VARCHAR, ZCUSTOM5 VARCHAR, ZCUSTOM6 VARCHAR, ZCUSTOM7 VARCHAR, ZCUSTOM8 VARCHAR, ZCUSTOM9 VARCHAR, ZCUSTOMTAG1 VARCHAR, ZCUSTOMTAG2 VARCHAR, ZCUSTOMTEXT1 VARCHAR, ZCUSTOMTEXT2 VARCHAR, ZDISCS VARCHAR, ZFREEBASE VARCHAR, ZGENRE VARCHAR, ZLOCALE VARCHAR, ZLOCALELANGUAGE VARCHAR, ZLOCATION VARCHAR, ZLOWESTNEWPRICE VARCHAR, ZLOWESTUSEDPRICE VARCHAR, ZPAID VARCHAR, ZPLACEDFORSALEAT VARCHAR, ZPRICE VARCHAR, ZPRODUCER VARCHAR, ZPURCHASEDAT VARCHAR, ZRATING VARCHAR, ZSERIES VARCHAR, ZSOLDPRICE VARCHAR, ZSORTTITLE VARCHAR, ZSUMMARY VARCHAR, ZTAGS VARCHAR, ZTITLE VARCHAR, ZTYPE VARCHAR, ZUPC VARCHAR, ZURL VARCHAR, ZASPECTRATIO VARCHAR, ZCOUNTRY VARCHAR, ZCREATOR VARCHAR, ZDIRECTOR VARCHAR, ZDURATION VARCHAR, ZFEATURES VARCHAR, ZIMDB VARCHAR, ZLANGUAGES VARCHAR, ZMEDIA VARCHAR, ZORIGINALTITLE VARCHAR, ZPICTUREFORMAT VARCHAR, ZRATED VARCHAR, ZREGION VARCHAR, ZSOUND VARCHAR, ZSTARRING VARCHAR, ZSTUDIO VARCHAR, ZSUBTITLES VARCHAR, ZTAGLINE VARCHAR, ZVIDEOFORMAT VARCHAR, ZWRITER VARCHAR, ZEXTRADATA BLOB );"//g | sed s/\,\ /\+\+\+/g | sed s/\,\"/"++-"/g | sed s/\,/\|/g | tr -d '\n' | sed 's/INSERT/\
INSERT/g' | sed s/"NULL"//g | sed s/"+++"/", "/g | sed s/"++-"/\,\"/g > "$databasedump"

sleep 1
echo "************Changing to Working Directory"
cd "/Users/joel/Movies/_Movies & TV Shows/4-Tagging"

#find movies to tag
for SOURCE in $(find * -maxdepth 0 -print) ; do
   echo "Tagging $SOURCE"
   sleep 1

filename=$(basename "$SOURCE")
	echo "Filename: $filename"
	echo "$filename" > "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"
directory=$(dirname "$SOURCE")
echo "$directory"
parentdirectory=$(dirname "$directory")
find "$directory" -type f -name ".*" -exec rm {} \;
filename=$((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | sed s/" - "/";"/g)
	echo "$filename" > "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"
title=$(((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | sed s/" #00"//g ) | sed s/\'\'/\'/g )
	echo "Movie Title: $title"
	echo "Movie Title: $title" >> "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"
episodenum=$((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | sed s/\#/\;#/g ) | cut -d \; -f 2 ) | cut -c 1 )
	if [ "$episodenum" = "#" ] ;
		then
			episodenum=$(((((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \; -f 1 ) | sed s/"-"//g ) | cut -d \: -f 1 )
			echo "Episode Number: $episodenum"
			echo "Episode Number: $episodenum" >> "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"
	else
			episodenum="01"
	fi

artist=$((((((grep "Movie Title:" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | sed s/" #"/";#"/g ) | sed s/"_"/":"/g ) | cut -c 14- ) | cut -d \; -f 1 ) | sed s/\'\'/\'/g )
	echo "Artist/AlbumArtist: $artist"
	echo "Artist/AlbumArtist: $artist" >> "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" 

album=$(((((((grep "Movie Title:" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | sed s/" #"/";#"/g ) | cut -c 14- ) | cut -d \; -f 2 ) | sed s/"_"/":"/g ) | cut -c 1-5 ) | sed s/\'\'/\'/g )

	if [ "$album" = "#00: " ] ;
		then	
			album=$(((((((grep "Movie Title:" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | sed s/" #"/";#"/g ) | cut -c 14- ) | cut -d \; -f 2 ) | sed s/"_"/":"/g ) | cut -c 6- ) | sed s/\'\'/\'/g )
		else
			album=$(((((((grep "Movie Title:" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | sed s/" #"/";#"/g ) | cut -c 14- ) | cut -d \; -f 2 ) | sed s/"_ "/":"/g ) | cut -d \: -f 1 ) | sed s/\'\'/\'/g )
	fi

year=$((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 2 )
	if [ "$year" = "0000" ] ;
		then
		year=""
	else
		year="$year"
	fi
	echo "Year: $year"
	echo "Year: $year" >> "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"

rating=$((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 3 )
	echo "Movie Rating: $rating"
	echo "Movie Rating: $rating" >> "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"

comment=$((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 4 ) | sed s/".m4v"//g ) | sed s/".mp4"//g )
comment2=$(((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 4 ) | sed s/".m4v"//g ) | sed s/".mp4"//g ) | cut -c 1-2 )
#stik="Short Film"

stik="Movie"

tvseason="$year"
	if [ "$comment2" = "TV" ] ;
		then
			stik="TV Show"
			tvseason=$(((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) 
			len=${#tvseason}
			if [ "$len" = 3 ] ;
			then
				tvseason=$((((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) | cut -c 1 )
				track=$((((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) | cut -c 2-3 )
			fi
			if [ "$len" = 4 ] ;
			then
				tvseason=$((((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) | cut -c 1-2 )
				track=$((((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) | cut -c 3-4 )
			fi
			if [ "$len" = 5 ] ;
			then
				tvseason=$((((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) | cut -c 1-3 )
				track=$((((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) | cut -c 4-5 )
			fi
			tvseason="$tvseason"
			echo "TV Season Number: $tvseason"
			title=$((((((grep "Movie Title:" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | sed s/" #"/";#"/g ) | cut -c 14- ) | cut -d \; -f 2 ) | sed s/"_"/":"/g ) | sed s/\'\'/\'/g )
			echo "Track Number: $track"
			echo "New Title: $title"
			album="$artist, Season $tvseason"
	else
			track="$episodenum"
	fi
	if [ "$comment" = "HDTV" ] ;
		then
			stik="TV Show"
			tvseason=$(((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) 
			len=${#tvseason}
			if [ "$len" = 3 ] ;
			then
				tvseason=$((((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) | cut -c 1 )
				track=$((((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) | cut -c 2-3 )
			fi
			if [ "$len" = 4 ] ;
			then
				tvseason=$((((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) | cut -c 1-2 )
				track=$((((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) | cut -c 3-4 )
			fi
			if [ "$len" = 5 ] ;
			then
				tvseason=$((((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) | cut -c 1-3 )
				track=$((((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/"_"/":"/g ) | cut -d \# -f 2 ) | cut -d \: -f 1 ) | cut -c 4-5 )
			fi
			tvseason="$tvseason"
			echo "TV Season Number: $tvseason"
			echo "Track Number: $track"
			title=$((((((grep "Movie Title:" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | sed s/" #"/";#"/g ) | cut -c 14- ) | cut -d \; -f 2 ) | sed s/"_"/":"/g ) | sed s/\'\'/\'/g )
			echo "New Title: $title"
			album="$artist, Season $tvseason"
	fi
	echo "Album: $album"
	echo "Album: $album" >> "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"

	if [ "$comment" = "MVDVD" ] ;
		then
			stik="Music Video"
	fi
			echo "Media Kind: $stik"			
			echo "Media Kind: $stik" >> "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"

#	if [ "$comment" = "Files" ] ;
#		then
#			comment="Converted from a File"
#			echo "Comments: $comment"
#			echo "Comments: $comment" >> "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"
#	else
#			comment="Ripped From DVD"
#			echo "Comments: $comment"
#			echo "Comments: $comment" >> "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"
#	fi

grouping=$((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 5 ) | sed s/".m4v"//g ) | sed s/".mp4"//g ) 
	if [ "$grouping" = "iTouch" ] ;
		then
		grouping="iPod Touch"	
		hdvideo="0"
	fi
	if [ "$grouping" = "HDAppleTV" ] ;
		then
		grouping="High Def AppleTV"
		hdvideo="1"
	fi
	if [ "$grouping" = "SDAppleTV" ] ;
		then
		grouping="Standard Def AppleTV"
		hdvideo="0"
	fi
	if [ "$grouping" = "AppleTV" ] ;
		then
		grouping="Standard Def AppleTV"
		hdvideo="0"
	fi
	echo "Grouping: $grouping"
	echo "Grouping: $grouping" >> "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"

genre=$((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 6 ) | sed s/".m4v"//g ) | sed s/".mp4"//g )
	echo "Genre: $genre"
	echo "Genre: $genre" >> "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"

advisory=$(((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 6 ) | sed s/".m4v"//g ) | sed s/".mp4"//g ) | cut -c 1-5 )
	if [ "$advisory" = "Adult" ] ;
		then
			advisory="Explicit"
			echo "Advisory: $advisory"
			echo "Advisory: $advisory" >> "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"
	else
			advisory=""
			echo "Advisory: $advisory"
			echo "Advisory: $advisory" >> "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"
	fi			

if [ "$genre" = "Adult" ] ;
	then
		artwork=$(((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/" #00"//g )
		artwork="$artwork/$artwork #000.jpg"
		artwork="/Users/joel/Pictures/Downloaded/$artwork"
	else
		artwork=$(((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 1 ) | sed s/" #00"//g )
		artwork="/Users/joel/Pictures/DVD Artwork/$artwork.jpg"
fi	

UPC=$((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 7 ) | sed s/".m4v"//g ) | sed s/".mp4"//g )
artworkuid=$((grep "$UPC" "$databasedump") | cut -d \| -f 12 )
# 4.9 artworkuid=$((grep "$UPC" "$databasedump") | cut -d \| -f 9 )
artwork="/Users/joel/Library/Application Support/DVDpedia/Covers/$artworkuid.jpg"

#len=${#cnID}
#if [ "$len" -gt 9 ] ;
#	then
#		cnID=$(((((grep "$filename" "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt" ) | cut -d \; -f 7 ) | sed s/".m4v"//g ) | sed s/".mp4"//g ) | cut -c 4- )
#fi

echo "UPC: $UPC"
director=$(((((grep "$UPC" "$databasedump") | sed s/\"\,\"/\"\;\"/g ) | sed s/\"//g ) | cut -d \| -f 79 ) | sed s/\'\'/\'/g )
# 4.9 director=$(((((grep "$UPC" "$databasedump") | sed s/\"\,\"/\"\;\"/g ) | sed s/\"//g ) | cut -d \| -f 73 ) | sed s/\'\'/\'/g )
	echo "Director: $director"
producer=$(((((grep "$UPC" "$databasedump") | sed s/\"\,\"/\"\;\"/g ) | sed s/\"//g ) | cut -d \| -f 63 ) | sed s/\'\'/\'/g )
# 4.9 producer=$(((((grep "$UPC" "$databasedump") | sed s/\"\,\"/\"\;\"/g ) | sed s/\"//g ) | cut -d \| -f 20 ) | sed s/\'\'/\'/g )
	echo "Producer: $producer"
summary=$(((((grep "$UPC" "$databasedump") | sed s/\"\,\"/\"\;\"/g ) | sed s/\"//g ) | cut -d \| -f 69 ) | sed s/\'\'/\'/g )
# 4.9 summary=$(((((grep "$UPC" "$databasedump") | sed s/\"\,\"/\"\;\"/g ) | sed s/\"//g ) | cut -d \| -f 52 ) | sed s/\'\'/\'/g )
	echo "Summary: $summary"
starring=$(((((grep "$UPC" "$databasedump") | sed s/\"\,\"/\"\;\"/g ) | sed s/\"//g ) | cut -d \| -f 89 ) | sed s/\'\'/\'/g )
# 4.9 starring=$(((((grep "$UPC" "$databasedump") | sed s/\"\,\"/\"\;\"/g ) | sed s/\"//g ) | cut -d \| -f 69 ) | sed s/\'\'/\'/g )
	echo "Starring: $starring"
studio=$((((grep "$UPC" "$databasedump") | sed s/\"\,\"/\"\;\"/g ) | sed s/\"//g ) | cut -d \| -f 91 )
# 4.9 studio=$((((grep "$UPC" "$databasedump") | sed s/\"\,\"/\"\;\"/g ) | sed s/\"//g ) | cut -d \| -f 61 )
	echo "Studio: $studio"
writer=$(((((((grep "$UPC" "$databasedump") | sed s/\"\,\"/\"\;\"/g ) | sed s/\"//g ) | cut -d \| -f 95 ) | sed s/\'\'/\'/g ) | sed s/");CREATE INDEX ZENTRY_Z_ENT_INDEX ON ZENTRY (Z_ENT);COMMIT;"//g ) | sed s/");"//g )
# 4.9 writer=$(((((grep "$UPC" "$databasedump") | sed s/\"\,\"/\"\;\"/g ) | sed s/\"//g ) | cut -d \| -f 66 ) | sed s/\'\'/\'/g )
	echo "Writer: $writer"

	echo "Artwork File: $artwork"

purchasedate=$(date "+%Y-%m-%d")

sleep 1

if [ -f "$artwork" ] ;
	then
		echo "Encoding WITH Artwork"
		art="1"
#{Comments:$comment}
		"$appdirectory/SublerCLI-0.10" -i "$SOURCE" -t "{cnID:$cnID}{Name:$title}{Artist:$artist}{Album Artist:$artist}{Album:$album}{TV Show:$artist}{TV Season:$tvseason}{TV Episode #:$episodenum}{TV Episode:$episodenum}{Grouping:$grouping}{Content Rating:$advisory}{Release Date:$year}{Genre:$genre}{Rating:$rating}{Purchase Date:$purchasedate}{Encoding Tool:$UPC}{Director:$director}{Producers:$producer}{Long Description:$summary}{Cast:$starring}{Screenwriters:$writer}{Copyright:$studio}{Artwork:$artwork}{Media Kind:$stik}{HD Video:$hdvideo}{Track #:$track}"
		sleep 1
else
		echo "Encoding WITHOUT Artwork"
		art="2"

		"$appdirectory/SublerCLI-0.10" -i "$SOURCE" -t "{cnID:$cnID}{Name:$title}{Artist:$artist}{Album Artist:$artist}{Album:$album}{TV Show:$artist}{TV Season:$tvseason}{TV Episode #:$episodenum}{TV Episode:$episodenum}{Grouping:$grouping}{Content Rating:$advisory}{Release Date:$year}{Genre:$genre}{Rating:$rating}{Purchase Date:$purchasedate}{Encoding Tool:$UPC}{Director:$director}{Producers:$producer}{Long Description:$summary}{Cast:$starring}{Screenwriters:$writer}{Copyright:$studio}{Media Kind:$stik}{HD Video:$hdvideo}{Track #:$track}"
		sleep 1
fi

if [ "$art" = "1" ] ;
	then
	echo "**********Moving to Subler Optimize Folder"
	mv "$SOURCE" "/Users/joel/Movies/_Movies & TV Shows/5-Subler Optimize/"

fi
if [ "$art" = "2" ] ;
	then
		echo "**********Waiting on Artwork"
		mv "$SOURCE" "/Users/joel/Movies/_Movies & TV Shows/6-Waiting for MetaX/"
fi
track=""
rm "/Users/joel/Movies/_Movies & TV Shows/0-Temp Files/movietagging.txt"
sleep 2
done
IFS="$OLDIFS"
rm "$tempfiles/taggingvideo.flag"
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Can DVDpedia tag .m4v files with iTunes meta data?

Post by Conor »

That is quite an impressive script. You might be interested in wrapping it up in a plugin for DVDpedia for easy access from the menu if you use it often. You can find information about the plugin architecture here and a Xcode sample here. The plugins sample is geared towards search sites, but you can delete all the search code and at the bottom of the Sample.m file there is a commented sections that shows how to create menu commands.

You could then call your bash scripts directly or actually work with the data directly from DVDpedia in Cocoa. For example yo could ask for the current selection and update the series information based on your custom fields.

Code: Select all

NSArray *selection = [[NSApp delegate] selectedEntries];
for (NSManagedObject *next in selection) {
    NSString *title = [next valueForKey:@"title"];
    NSString *series = [next valueForKey:@"series"];
    NSString *name = [title stringByReplacingOccurrencesOfString:series withString:@""];
    [next setValue:name forKey:@"custom2"];
}


Cocoa is a bit more complex but it allows you to do things that would not be possible in SQL, for example with the new Mac 10.7 regular expression support you could choose to remove the numbered bit from the tile.

In a similar fashion you could roll in libraries to handle MP4 directly from Cocoa such a this one in Google Code.

You already have an awesome working script. I just wanted to drop this information here as users sometimes forget there is a fully extensible plugin architecture to DVDpedia that can be exploited for customization.
Post Reply