[qcineoob] checkbox to show thumbnail in search

[allocine] fix empty productionYear problem
This commit is contained in:
Julien Veyssier 2013-03-26 16:00:31 +01:00
commit d6a0291deb
4 changed files with 23 additions and 4 deletions

View file

@ -229,7 +229,10 @@ class AllocineBrowser(BaseBrowser):
for m in jres['participation']: for m in jres['participation']:
if m['activity']['$'] not in roles: if m['activity']['$'] not in roles:
roles[m['activity']['$']] = [] roles[m['activity']['$']] = []
roles[m['activity']['$']].append(u'(%s) %s' % (m['movie']['productionYear'], m['movie']['originalTitle'])) pyear = '????'
if 'productionYear' in m['movie']:
pyear = m['movie']['productionYear']
roles[m['activity']['$']].append(u'(%s) %s' % (pyear, m['movie']['originalTitle']))
person = Person(id, name) person = Person(id, name)

View file

@ -40,6 +40,9 @@ 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)
if self.parent.ui.showTCheck.isChecked():
self.gotThumbnail()
def gotThumbnail(self): def gotThumbnail(self):
if empty(self.movie.thumbnail_url): if empty(self.movie.thumbnail_url):
self.backend.fill_movie(self.movie, ('thumbnail_url')) self.backend.fill_movie(self.movie, ('thumbnail_url'))

View file

@ -46,6 +46,9 @@ class MiniPerson(QFrame):
self.ui.shortDescLabel.hide() self.ui.shortDescLabel.hide()
self.ui.backendLabel.setText(backend.name) self.ui.backendLabel.setText(backend.name)
if self.parent.ui.showTCheck.isChecked():
self.gotThumbnail()
def gotThumbnail(self): def gotThumbnail(self):
self.backend.fill_person(self.person, ('thumbnail_url')) self.backend.fill_person(self.person, ('thumbnail_url'))
if not empty(self.person.thumbnail_url): if not empty(self.person.thumbnail_url):

View file

@ -142,6 +142,16 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item>
<widget class="QCheckBox" name="showTCheck">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;may slow search process&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Show thumbnails</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
@ -218,7 +228,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>708</width> <width>708</width>
<height>261</height> <height>260</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"/> <layout class="QVBoxLayout" name="verticalLayout_2"/>
@ -239,8 +249,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>78</width> <width>96</width>
<height>18</height> <height>26</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_8"/> <layout class="QVBoxLayout" name="verticalLayout_8"/>