English > Development
PvdImport image selection
nostra:
--- Quote ---In other words, even though the poster selected for display can't be identified, can it be done in such a way that "poster #1" is the one retrieved?
--- End quote ---
There is no way to be sure which post you get (currently). ;)
--- Quote ---If it's possible to do this via SQL, then that would definitely be the best solution since that is the only way PvdImport currenly communicates with PVD.
Is there some kind of record in the database, perhaps, that keep track of "selected images"? In my DB, I've only got one image per movie, so this hasn't been an issue for me...
--- End quote ---
Select one (random) poster as BLOB (you will get actual bytes of the post in "imgdata" field) (this poster is shown for a movie if you have not manually defined default poster):
--- Code: ---SELECT FIRST 1 * FROM IMAGES WHERE ("imgtype" = 0) AND ("mid" = %d)
--- End code ---
Select all posters as BLOB (you will get actual bytes of the post in "imgdata" field):
--- Code: ---SELECT * FROM IMAGES WHERE ("imgtype" = 0) AND ("mid" = %d)
--- End code ---
Select poster set as default as BLOB (you will get actual bytes of the post in "imgdata" field):
--- Code: ---SELECT * FROM IMAGES
INNER JOIN MOVIES ON (MOVIES."mid" = IMAGES."mid" AND MOVIES."defposter" = IMAGES."imgid")
WHERE IMAGES."mid" = %d
--- End code ---
Note: This code will return nothing if no poster is set as default
rick.ca:
Thanks!
--- Quote ---This code will return nothing if no poster is set as default
--- End quote ---
I assume raldo will be able to figure out how to combine this statement with the first one—so if there is no default poster, a random one will be retrieved.
nostra:
--- Quote ---I assume raldo will be able to figure out how to combine this statement with the first one—so if there is no default poster, a random one will be retrieved.
--- End quote ---
Should be easy...
raldo:
--- Quote from: nostra on September 17, 2009, 02:13:03 am ---MOVIES."defposter" = IMAGES."imgid"
--- End quote ---
Thanks, Nostra, It's now on my list of todos in PvdImport...
Navigation
[0] Message Index
[*] Previous page
Go to full version