import timestamp + mixed rating

Any trouble you encounter with the Pedias, here's the place to ask for help.
Post Reply
Vinz
Contributor
Contributor
Posts: 5
Joined: Thu Jun 21, 2007 7:34 pm

import timestamp + mixed rating

Post by Vinz »

Hi there,

i got some question;

I imported my DVD DB into DVDpedia from e textfile. The textfile looks like this:

Code: Select all

Title,Slot,IMDb Number,Nr of Disks/Tapes,Last Modified

13 Going On 30,151,0337563,1,20/06/2006 14:35:14

24 Hour Party People,269,0274309,1,20/06/2006 14:35:14

25th Hour,275,0307901,1,20/06/2006 14:35:14

And so on
problem 1:
the problem is that the timestamp of last modified ( of DVDpedia is in MM-DD-YYYY and the import is as you can see DD/MM/YYYY HH:MM:SS. is there anywhay to fix this problem? I already looked to change the export into the good timestamp but its not possible.


problem 2:
I want to get all the information of a movie from moviemeter.nl because it's in dutch. The problem is that some movies are not on the site, so i get the information about that movie from IMDB. The thing is that here the rating is given on a total out of 10, and on moviemeter.nl it is on a total of 5.
Is there anyway i can automaticly devide the rating of IMDB by 2, so that it is also on a total of 5.


--> is there a way to only display the rating (so not the number of total votes behind it?)
--> is there a way to format the rating (e.g. 1 decimal after the comma)


tnx in advance!
User avatar
Conor
Top Dog
Posts: 5344
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Post by Conor »

You have challenging questions. The first one, I would hope to be able to say that changing your computers date format would be enough, but the truth is Apple Cocoa framework ignores that value and uses the American MM/DD/YYYY format when there is ambiguity. We could have been strict about the format of the date but it would limit the types of imports. Since the file is a text file the thing to do is to change the text file to remove the ambiguity from the dates or flip the digits. Download TextWrangler and use the following regular expression to flip the dates:
find:

Code: Select all

,([0-9]{2})/([0-9]{2})/([0-9]{4})
replace with:

Code: Select all

,\2/\1/\3
There is no way to do change the IMDb rating as it is imported except to change the IMDb plug-in to do this. You would have to be able to have some programming knowledge and Xcode installed on your computer. Since your doing a large import from a text file you can change the rating manually by hand afterwards, once your collection is complete; using the multi edit function, you would only have to do it 5 times. Select all the entries that have IMDb information and sort them by rating. Then select from 10 to 9 using shift and press edit to change the rating for all to 5, same for 8 and 7 to 4, and so on. This would mean you also remove the number of votes for each entry, but this works out as you don't want that information.

Thank you for the information, will keep in mind what you would need these kinds of features in a future version.
Vinz
Contributor
Contributor
Posts: 5
Joined: Thu Jun 21, 2007 7:34 pm

Post by Vinz »

that did the trick perfect.. tnx alot Conor!

great support to!
Vinz
Contributor
Contributor
Posts: 5
Joined: Thu Jun 21, 2007 7:34 pm

Post by Vinz »

i got some other question too, but i didn't find it worth opening another thread so i'll continue here :wink:

by mistake when I imported the .txt i assigned the slot field to the wrong field('location' instread of 'number collection'). I already altered the whole database where necesseary wich took alot of time, so I would prefer another method than a new import to adjust this. Also manually copying the location field to the number collection (i guess this is the field CollectionID in the english version?) is a bit much work.


2nd little question, is it possible to export the whole DB into a XML of this kind:

Code: Select all

<DVDpedia>
  <movie>
    <name>Braveheart</name>
    <author>Mel Gibson</author>
    <writer>Randall Wallace</writer>
    ... other fields ....
  </movie>
  <movie>
    <name>Top Gun</name>
    <author>Tom Cruise</author>
    <writer>Ehud Yonay</writer>
    ... other fields ....
  </movie>
</DVDpedia>
If wanted there can be more levels, and attributes can be used. The reason for this is because i want to make a front end in Flash for my DB, and this kind of XML is relatively easy to read in.


tnx again in advance
User avatar
Conor
Top Dog
Posts: 5344
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Post by Conor »

The native .dvdpedia export is XML. It's really a package so you need to ctrl-click the resulting file and choose "show package contents" inside you will find the XML file and a folder with all the covers. The movies are in the order that you had them, they also have a key that corresponds to the image number; you can use this to display the cover in Flash as well.

It's also through the export that you would be able to flip one column for the another column. Export your entire Library collection and then open the XML in a text editor and change "<key>Location</key>" for "<key>Collection</key>" and double click the .dvdpedia package to import it. An import will create an excluded collection; delete all the entries from your current Library and then select the new imported collection and choose include in Library from the file menu. Of course when playing around with such massive changes and deleting so many entries it's good to make a copy of your database file (~Library/Application Support/Database.pediadata).
Post Reply