Updating a Large Number of Links

Any trouble you encounter with the Pedias, here's the place to ask for help.

Updating a Large Number of Links

Postby spishak » Sun Jun 14, 2015 12:05 pm

I recently bought a new, larger external drive and want to change all the links in DVDPedia that are pointing to movies on the old drive to point to the exact same movies on the new drive. Let's say I have 1,000 movies neatly and beautifully catalogued residing on Drive1 ... I then copy the entire library of movies (using the Finder), from Drive1 to new Drive2. Can I update all 1,000 links in DVDPedia to point to Drive2 without editing each record individually? I'm hoping so, and thankful for any help you can provide. --Chris
spishak
Bruji Friend
Bruji Friend
 
Posts: 11
Joined: Sun Jun 14, 2015 11:54 am

Re: Updating a Large Number of Links

Postby Nora » Sun Jun 14, 2015 2:55 pm

You can do that using the application Terminal found in Applications/Utilities. First though, start by quitting DVDpedia and making a copy of your DVDpedia data folder as a precaution. By default the DVDpedia folder is located in your Home folder under ~/Library/Application Support/DVDpedia. If you don't see the ~/Library/ folder in Home you can use the Finder's 'Go' menu, hold down the Option key and the Library folder will appear.

After that, run Terminal and copy paste the following lines into the window, each followed by a return:

Code: Select all
sqlite3 ~/Library/Application\ Support/DVDpedia/Database.dvdpd
update ZLINK Set ZURL = replace(ZURL, 'file:///Drive1', 'file:///Drive2');
.exit


Then restart DVDpedia and all your links will be updated to the new Drive2 location.
User avatar
Nora
Site Admin
 
Posts: 2149
Joined: Sun Jul 04, 2004 5:03 am

Re: Updating a Large Number of Links

Postby spishak » Sun Jun 14, 2015 6:53 pm

Thank you so much Nora for the quick and thorough reply. I did add the phrase "Volumes/" to the syntax you provided to get it to work for me. So I structured it like this >>>

sqlite3 ~/Library/Application\ Support/DVDpedia/Database.dvdpd
update ZLINK Set ZURL = replace(ZURL, 'file:///Volumes/Drive1', 'file:///Volumes/Drive2');
.exit

After that, it worked like a charm and saved me oodles of time (and boredom)!
spishak
Bruji Friend
Bruji Friend
 
Posts: 11
Joined: Sun Jun 14, 2015 11:54 am


Return to Support

cron