Save or Export Movie Posters with movie name?

Talk to other Pedia users about the programs, share tricks and tips or ask questions about existing features.
User avatar
sitenoise
Addicted to Bruji
Addicted to Bruji
Posts: 228
Joined: Fri Mar 21, 2008 12:42 pm
Contact:

Save or Export Movie Posters with movie name?

Post by sitenoise »

Is there a way to Save or Export all the posters in a collection, such that the resulting image files will have the title of the movie instead of a random number?
User avatar
Nora
Site Admin
Posts: 2155
Joined: Sun Jul 04, 2004 5:03 am
Contact:

Re: Save or Export Movie Posters with movie name?

Post by Nora »

It's not possible at this point but we'll keep it in mind for the future. Thanks for the suggestion.
User avatar
sitenoise
Addicted to Bruji
Addicted to Bruji
Posts: 228
Joined: Fri Mar 21, 2008 12:42 pm
Contact:

Re: Save or Export Movie Posters with movie name?

Post by sitenoise »

Not a big deal, really, but I'll tell you why I ask. I'm about to do a system backup to discs, and I was thinking "What if I had to completely rebuild my DVDPedia database"? I can't actually imagine the circumstances in which something like this would occur, but I've spent a considerable amount of time over the years getting just the right posters at just the right sizes, etc, and thought it would be cool, if I ever had to, instead of having to search for them all again, if they were all just there in a folder, aptly named.

The same is true for iTunes, only the iTunes situation is (was) worse. I'm sure you're aware of the crazy directory structure in which iTunes stores Album Artwork. Not to mention that it's in some format that isn't preview-able. So I found this script, at http://www.dougscripts.com/itunes/ called Save Album Art to Album Folder v4.1 that rips (well not rips, it takes a considerable amount of time with a big library) through your Library and exports one album cover per album, named with the artist and album, to a folder of your choice. Cool, except for the 300 out of 3,000 it failed with, although it did create an empty file with the artist and album name so I know which ones it failed on (probably the legacy ones with auto-downloaded artwork from iTunes 1.0 ... because the artwork for these fails is there in iTunes, usually only for the first track, and it's tiny and bad quality, something I would not have searched for and added myself).

Don't get me wrong. I Superduper clone my machine weekly and run daily Mozy backups to the Cloud. But if my house burns down, the Clone will be useless, and I don't backup the DVDPedia Covers Folders or the iTunes Artwork Folder to the Cloud because they are each over a Gig in size. I do, of course, backup the DVDPedia database to the cloud, daily.

So there you have it. Silly, perhaps, but that's why I asked.
User avatar
Conor
Top Dog
Posts: 5344
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Save or Export Movie Posters with movie name?

Post by Conor »

I had guessed that you might be using XBMC along with DVDpedia, since XBMC expects an export of an information file and an image with the same name as the movie for each movie folder (we have the NFO export but not the image naming export yet). In fact if you would like you can use the same solution to export covers that XBMC users use. It's a customized text export from DVDpedia that builds a script that creates a copy of each cover to a new location using the movie name for the file. Nora did not know about it, even though the post is in her name it must have been me writing that due to the technical nature. Be sure to change the last extension on the script to "jpg" from "tmb" and of course the path that you would like to put the covers in.

I understand that you would like to be able to easily identify a cover by name without having to preview it; however, if you are not backing up your covers it's not going to really matter what name they have if you lose them. :shock: We use SuperDuper! as well, and also TimeMachine, Git, Dropbox and BackBlaze. We have never used Mozy so I can't compare, but the reason we use BackBlaze is that it backs up almost everything without the 50 or 125 gigabyte limit that Mozy has and for a lower price. If you don't backup your application folder (you can move apps outside of this folder to have BackBlaze pick them up) and you're not using Mozy in the style of Dropbox – to hold files that don't exist on your computer – then I recommend taking a look at BackBlaze.
User avatar
sitenoise
Addicted to Bruji
Addicted to Bruji
Posts: 228
Joined: Fri Mar 21, 2008 12:42 pm
Contact:

Re: "the style of Dropbox"

Post by sitenoise »

I'm Terminally shy so that script looks a little scary, but I'll give it a deeper look. Thanks.

Not to hijack my own thread in a different direction but you wrote something about backing up that I'd like to understand more clearly:
you're not using Mozy in the style of Dropbox – to hold files that don't exist on your computer
.

I do backup my posters, btw, with the weekly clone, and the quarterly-to-disc offsite set, which is what I'm doing now. I use Dropbox but it doesn't include DVDPedia stuff because it only deals with what you put in the Dropbox Folder (and I never felt like I understood the 'symbolic link' workarounds well enough to use them).

But anyway, by "style of Dropbox – to hold files that don't exist on your computer" ... well, what do you mean? :D I use the "Web Archive" feature of Sugarsync to do that (and am probably going to add the DVDPedia and iTunes Artwork Folders to it, or possibly the live Syncing Queue), but didn't think you could do that with Dropbox. It seems to serve only as a mirror of what is on my computer. And it's fast. Sugarsync is quite slow, btw, which is why I have only used it so far as a "hold files that don't exist on my computer" kind of way. Basically (and these files do exist on my computer but they are not "synced'), whenever I create an iPhoto Album, I export it, and then throw the photos into Sugarsync's Web Archive, and then I have access to my entire iPhoto Library with my iPhone (or any other computer), without having to actually sync all the photos to it, but I digress.

The reason I ask about this is because I think I don't understand something. Dropbox seems great in an "oops, I've lost my computer" sort of way, but not so good in an "oops, I've done something stupid and have messed up my DVDPedia database" kind of way. Case in point just happened to me: I selected all the Movies in my Library that had IMDb IDs but no Ratings and did a "New Collection from Selection" in order to 'Get Advanced Info' and add the Ratings. But then I selected all the ones with IMDb IDs but no Ratings from my Wish List and dragged them into that newly created Collection. And then proceeded to do it to a couple other 'excluded' Collections. It took me a while to realize the error of my ways, that it had just added the ones from my Excluded Collections to my Library, long enough that had I needed to rely on a Dropbox solution it would have most likely been overwritten with the newly messed up version, because Dropbox is fast. I grabbed last night's Mozy backup and was back where I started, good to go.

One nice thing about Mozy is that you get access to 30 days worth of versions that don't count against your quota.

I'll have a look at BackBlaze. Thanks for the tip.
User avatar
Conor
Top Dog
Posts: 5344
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Save or Export Movie Posters with movie name?

Post by Conor »

It was the wrong analogy. Dropbox has a synced folder on your computer that includes everything on Dropbox and hence anything in Dropbox would be on your computer. What I wanted to say was since Dropbox and Mozy charge by the gigabyte I was under the impression that you could add a file to Mozy and then remove it from your computer and when you want it you can download it again from Mozy. If Mozy automatically syncs and deletes files that you have also deleted from your computer after 30 days, then I am not sure what the advantage of Mozy are over Backblaze? Since Backblaze (as well as Dropbox) will keep 30 days worth of versions.

The advantage of Dropbox (and I hope of Mozy) is that if I don't sync Dropbox for a year all my files will still be there, since I am paying for the gigabyte space. This is not the case with Backblaze, even though you might have an active account and be be paying them, if they haven't seen your computer online for 6 months they will delete your entire backup from their servers.

Never heard of SugarSync, so many cloud storage options.
User avatar
sitenoise
Addicted to Bruji
Addicted to Bruji
Posts: 228
Joined: Fri Mar 21, 2008 12:42 pm
Contact:

Re: Save or Export Movie Posters with movie name?

Post by sitenoise »

A few things ...
I'm glad I learned Dropbox also keeps 30 days of files. I didn't realize that before.
Checked out Backblaze. The '6 months and we forget about you' sort of bummed me out, and the Program seemed rather intrusive. As you say, many cloud storage places popping up so there are many to choose from. I think I'll pass on that one. A couple of others I ran into: Spideroak and Box.net. The former sort of Mozyish, the latter like a dumping ground.

But back to the Export thing. I tried that script, and had read here that it runs too fast in Terminal and misses some. I tried just pasting 20 at a time and it only got 19 of them. I Tried iTerm 2 and it only got 27 of a collection of 143 titles. Don't know what to do here.
User avatar
Conor
Top Dog
Posts: 5344
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Save or Export Movie Posters with movie name?

Post by Conor »

There shouldn't be a speed issue. Every cover should get copied. What I can think of is that a quote in a title will break it. Copy all to Terminal and then look for the last cover copied and then search the script for that title, should be the next line in the culprit, you can try running just that one line, find out what error it gives.

With the 19 out of 20, it could simply be the last line you need to hit return after copying to have it run. The return executes the last copied line (e.i. the terminal should end in being the prompt only, which is your user name).
User avatar
sitenoise
Addicted to Bruji
Addicted to Bruji
Posts: 228
Joined: Fri Mar 21, 2008 12:42 pm
Contact:

Re: Save or Export Movie Posters with movie name?

Post by sitenoise »

I'm just going to go through 10 at a time. :roll: There are so many things that seem to break it ...

I tried doing 100 at a time and got around 60 or 70, and then spent half an hour trying to figure out which ones didn't make it. The fact that the output list doesn't sort the same, because of 'articles' like a, an, and the, make it a scrolling nightmare. I never discovered any quotes in titles but I did have some slashes '/' and those were trouble. As were !'s and duplicate title names, to name a few. So it's just faster to do 10 at a time. It'll take a while to get through thousands, but it's monotonous work instead of infuriating.
User avatar
Conor
Top Dog
Posts: 5344
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Save or Export Movie Posters with movie name?

Post by Conor »

Slashes would be an issue. I had not considered the exclamation mark. :oops: Those can be fixed by using single quotes in the template instead of double quote, but this means that the apostrophe becomes an issue. Since DVDpedia does not know it's for a script you could use a simpler template and then expand it in a text editor to fix the special characters that need encoding.

Code: Select all

<!--BeginRepeat-->cp -f COVER_PATH[key:uid].jpg MY_PATH[key:title].jpg
<!--EndRepeat-->
Then you would find and replace for the following:
  • 1. Find slash / and replace with : (this is what OS X will show as a slash in the Finder, but it's probably safer and easier to replace for a dash or something else that has no special meaning)
    2. Find backslash \ and replace with double backslash \\
    3. Find exclamation point ! and replace with \!
    3. Find dollar sign $ and replace with \$
    4. Find COVER_PATH and replace with "/Users/[UserName]/Library/Application Support/DVDpedia/Covers/
    5. Find MY_PATH and replace with path "/Users/[UserName]/Desktop/Movies/
    6. Find .jpg and replace with path .jpg" would do both ends of each path as they both end in .jpg
All the extra MY_PATH bits are to deal with the slash and apostrophe, to discard those and do those by hand you could use the template you have now change the double quotes to single quotes and do a smart collection of title does not contain / and title does not contain ' that should export and run in a single batch without issue, the final cover count should confirm it. And then a smart collection for movie is not in previous smart collection, so that you know which ones you have to handle yourself.

Of course that still leaves the issue of duplicate titles will want to write to the same cover and you will only save the cover for the last title. You could add something extra to the template like the [key:uid] or [key:director] to make it unique and avoid that.

It's not an easy problem to solve. :)

Update: fixed all the corrections below, including the fact that it didn't actual work for apostrophes.
User avatar
sitenoise
Addicted to Bruji
Addicted to Bruji
Posts: 228
Joined: Fri Mar 21, 2008 12:42 pm
Contact:

Re: Save or Export Movie Posters with movie name?

Post by sitenoise »

Ha! I hate to see you spending any time on this, but in case someone else is watching ...

a few questions:

instruction #3, <Find apostrophe ' and replace with \'.> ... is that a period at the end? If so, why?
instruction #4 ... shouldn't the <replace with ...> begin with an ' ... as in 'Users ...
instruction #6 (the second #5 :D ) <replace with path jpg'> shouldn't it be <replace with .jpg'> (needs a period?)

Assuming corrections to #4 & #6, it looks like it works except for titles with apostrophes. They end up like this <... Don\'t ...> (and I tried <...Don\'.t ...>) and don't work.

I don't know the lingo, but it seems a \ means escape or something and to use the next character literally and not as an operator. So and but I dunno why it doesn't work.
User avatar
Conor
Top Dog
Posts: 5344
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Save or Export Movie Posters with movie name?

Post by Conor »

3. Typo: reflex to put a period at end of things.
4. The first path is based on a number, so there is no need to escape the first path, hence also why a double quote is not replaced and not part of the find.
6. Indeed: extra period from 3 should find a new home at this location, where it was missing.

The backslash does indeed mean escape the following character. The only characters that should have special meaning inside single quotes should be the single quote and forward slash as it's part of a path and I assumed the escape would work, but it seems that bash (the terminal type) is complicated about single quotes. So the escape would actually have to be:

Code: Select all

'/Users/me/Desktop/It'\''s Great When it Works.jpg'
And that is just getting a bit crazy, so instead of replacing apostrophe for '\'' I've gone ahead and updated the above instruction set to keep the double quotes (added later to be able to escape double quotes) and escape the extra characters that have meaning in double quotes like exclamation point and dollar sign. That should make it more fool-proof for those stumbling along this post in years to come.
User avatar
sitenoise
Addicted to Bruji
Addicted to Bruji
Posts: 228
Joined: Fri Mar 21, 2008 12:42 pm
Contact:

Re: Save or Export Movie Posters with movie name?

Post by sitenoise »

I was just composing an update note, and got your update which will require some study. This is what I was writing.

this is weird. If I do an Export using:

Code: Select all

<!--BeginRepeat-->cp -f "COVER_PATH[key:uid].jpg" "MY_PATH[key:title] [[key:theatrical]] • [key:country].jpg"
<!--EndRepeat-->
And then do the find/replace (I use TextWrangler to do it all in a script), I get 9 out of 226. Terminal won't do any more after the first title with an apostrophe.

But if I do an Export using:

Code: Select all

<!--BeginRepeat-->cp -f "COVER_PATH[key:uid].jpg" "MY_PATH[key:title] ([key:OriginalTitle]) [[key:theatrical]] • [key:country].jpg"
<!--EndRepeat-->
I get 215 of 226

(btw, out of 226, there are 9 titles with apostrophe ... and I would assume adding the [key:OriginalTitle] would introduce me to a world of hurt, given the potential for weird characters, but it performed better) splain that
User avatar
sitenoise
Addicted to Bruji
Addicted to Bruji
Posts: 228
Joined: Fri Mar 21, 2008 12:42 pm
Contact:

Re: Save or Export Movie Posters with movie name?

Post by sitenoise »

totally works! :D I got 224 out of 226 and it took me a moment to realize that that's because there are two titles without Cover art.

So now :lol: How can I create a smart collection or do a find to find those without cover art for temporary exclusion.

Wait. I just won't worry about it. :)

Once again, Conor, you've gone miles beyond the call of duty. Thanks millions!
User avatar
Conor
Top Dog
Posts: 5344
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Save or Export Movie Posters with movie name?

Post by Conor »

Glad it works! :D Although, it will be possible to create a smart collection for those without cover; there is no need to exclude the two without cover art, it will simply ignore them (Terminal prints out an error in saying something along the lines of "file at path not found", but will carry on with the others).
Post Reply