[qcineoob] miniperson and minimovie thumbnail on demand, still slow
This commit is contained in:
parent
93757f8409
commit
b906c3300a
2 changed files with 18 additions and 10 deletions
|
|
@ -39,7 +39,8 @@ class MiniMovie(QFrame):
|
||||||
self.ui.shortDescLabel.setText(movie.short_description)
|
self.ui.shortDescLabel.setText(movie.short_description)
|
||||||
self.ui.backendLabel.setText(backend.name)
|
self.ui.backendLabel.setText(backend.name)
|
||||||
|
|
||||||
def gotThumbnail(self, backend, movie):
|
def gotThumbnail(self):
|
||||||
|
self.backend.fill_movie(self.movie,('thumbnail_url'))
|
||||||
if self.movie.thumbnail_url != NotAvailable:
|
if self.movie.thumbnail_url != NotAvailable:
|
||||||
data = urllib.urlopen(self.movie.thumbnail_url).read()
|
data = urllib.urlopen(self.movie.thumbnail_url).read()
|
||||||
img = QImage.fromData(data)
|
img = QImage.fromData(data)
|
||||||
|
|
@ -56,6 +57,9 @@ class MiniMovie(QFrame):
|
||||||
def mousePressEvent(self, event):
|
def mousePressEvent(self, event):
|
||||||
QFrame.mousePressEvent(self, event)
|
QFrame.mousePressEvent(self, event)
|
||||||
|
|
||||||
|
if event.button() == 2:
|
||||||
|
self.gotThumbnail()
|
||||||
|
else:
|
||||||
QApplication.setOverrideCursor( Qt.WaitCursor )
|
QApplication.setOverrideCursor( Qt.WaitCursor )
|
||||||
movie = self.backend.get_movie(self.movie.id)
|
movie = self.backend.get_movie(self.movie.id)
|
||||||
if movie:
|
if movie:
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,8 @@ class MiniPerson(QFrame):
|
||||||
self.ui.shortDescLabel.hide()
|
self.ui.shortDescLabel.hide()
|
||||||
self.ui.backendLabel.setText(backend.name)
|
self.ui.backendLabel.setText(backend.name)
|
||||||
|
|
||||||
def gotThumbnail(self, backend, person):
|
def gotThumbnail(self):
|
||||||
|
self.backend.fill_person(self.person,('thumbnail_url'))
|
||||||
if self.person.thumbnail_url != NotAvailable:
|
if self.person.thumbnail_url != NotAvailable:
|
||||||
data = urllib.urlopen(self.person.thumbnail_url).read()
|
data = urllib.urlopen(self.person.thumbnail_url).read()
|
||||||
img = QImage.fromData(data)
|
img = QImage.fromData(data)
|
||||||
|
|
@ -62,6 +63,9 @@ class MiniPerson(QFrame):
|
||||||
def mousePressEvent(self, event):
|
def mousePressEvent(self, event):
|
||||||
QFrame.mousePressEvent(self, event)
|
QFrame.mousePressEvent(self, event)
|
||||||
|
|
||||||
|
if event.button() == 2:
|
||||||
|
self.gotThumbnail()
|
||||||
|
else:
|
||||||
QApplication.setOverrideCursor( Qt.WaitCursor )
|
QApplication.setOverrideCursor( Qt.WaitCursor )
|
||||||
person = self.backend.get_person(self.person.id)
|
person = self.backend.get_person(self.person.id)
|
||||||
if person:
|
if person:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue