projects
/
cinaest
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d234ceb
)
Movie poster factory: use the new IMDb poster downloader
author
Philipp Zabel
<philipp.zabel@gmail.com>
Wed, 4 Aug 2010 22:14:38 +0000
(
00:14
+0200)
committer
Philipp Zabel
<philipp.zabel@gmail.com>
Thu, 5 Aug 2010 19:04:59 +0000
(21:04 +0200)
src/poster/movie-poster-factory.vala
patch
|
blob
|
history
diff --git
a/src/poster/movie-poster-factory.vala
b/src/poster/movie-poster-factory.vala
index
4c74c00
..
20e223b
100644
(file)
--- a/
src/poster/movie-poster-factory.vala
+++ b/
src/poster/movie-poster-factory.vala
@@
-33,12
+33,12
@@
namespace MoviePoster {
construct {
try {
var conn = DBus.Bus.get (DBus.BusType.SESSION);
construct {
try {
var conn = DBus.Bus.get (DBus.BusType.SESSION);
- server = conn.get_object ("org.maemo.movieposter.GoogleImages",
- "/org/maemo/movieposter/GoogleImages",
+ server = conn.get_object ("org.maemo.movieposter.IMDb",
+ "/org/maemo/movieposter/IMDb",
"org.maemo.movieposter.Provider");
server.Fetched.connect (this.on_poster_fetched);
} catch (Error e) {
"org.maemo.movieposter.Provider");
server.Fetched.connect (this.on_poster_fetched);
} catch (Error e) {
- warning ("Couldn't connect to Google image downloader: %s\n", e.message);
+ warning ("Couldn't connect to IMDb poster downloader: %s\n", e.message);
}
gc = GConf.Client.get_default ();
}
gc = GConf.Client.get_default ();
@@
-84,14
+84,19
@@
namespace MoviePoster {
public int queue_thumbnail (Movie movie, uint width, uint height, bool cropped, RequestCallback callback) throws Error {
string path = get_path_thumbnail (movie);
public int queue_thumbnail (Movie movie, uint width, uint height, bool cropped, RequestCallback callback) throws Error {
string path = get_path_thumbnail (movie);
+ foreach (Request request in requests)
+ if (request.movie == movie)
+ return 0;
+
if (FileUtils.test (path, FileTest.IS_REGULAR)) {
// TODO: make this async?
if (FileUtils.test (path, FileTest.IS_REGULAR)) {
// TODO: make this async?
- var pixbuf = new Gdk.Pixbuf.from_file_at_size (path, (int) width, (int) height);
+ var pixbuf = new Gdk.Pixbuf.from_file_at_scale (path, (int) width, (int) height, true);
+
callback (pixbuf, movie);
} else if (server != null && download_posters) {
var request = new Request ();
callback (pixbuf, movie);
} else if (server != null && download_posters) {
var request = new Request ();
- request.handle = server.FetchThumbnail (movie.title.down (), movie.year.to_string (), "movie");
+ request.handle = server.FetchThumbnail (movie.title, movie.year.to_string (), "movie");
request.movie = movie;
request.callback = callback;
request.width = (int) width;
request.movie = movie;
request.callback = callback;
request.width = (int) width;