From b800ae1751e39a164bca832e372db75e811b7266 Mon Sep 17 00:00:00 2001 From: "beville@gmail.com" Date: Fri, 12 Apr 2013 01:56:24 +0000 Subject: [PATCH] Added issue description to the match and issue selection dialogs git-svn-id: http://comictagger.googlecode.com/svn/trunk@591 6c5673fe-1810-88d6-992b-cd32ca31540c --- comictaggerlib/autotagmatchwindow.py | 6 +- comictaggerlib/comicvinecacher.py | 5 +- comictaggerlib/comicvinetalker.py | 4 +- comictaggerlib/issueidentifier.py | 1 + comictaggerlib/issueselectionwindow.py | 5 ++ comictaggerlib/matchselectionwindow.py | 6 +- comictaggerlib/ui/autotagmatchwindow.ui | 101 ++++++++++++++-------- comictaggerlib/ui/issueselectionwindow.ui | 100 ++++++++++++++------- comictaggerlib/ui/matchselectionwindow.ui | 101 ++++++++++++++-------- 9 files changed, 215 insertions(+), 114 deletions(-) diff --git a/comictaggerlib/autotagmatchwindow.py b/comictaggerlib/autotagmatchwindow.py index bfc2e94..b66dc6f 100644 --- a/comictaggerlib/autotagmatchwindow.py +++ b/comictaggerlib/autotagmatchwindow.py @@ -38,7 +38,7 @@ class AutoTagMatchWindow(QtGui.QDialog): def __init__(self, parent, match_set_list, style, fetch_func): super(AutoTagMatchWindow, self).__init__(parent) - uic.loadUi(ComicTaggerSettings.getUIFile('autotagmatchwindow.ui' ), self) + uic.loadUi(ComicTaggerSettings.getUIFile('matchselectionwindow.ui' ), self) self.altCoverWidget = CoverImageWidget( self.altCoverContainer, CoverImageWidget.AltCoverMode ) gridlayout = QtGui.QGridLayout( self.altCoverContainer ) @@ -161,6 +161,10 @@ class AutoTagMatchWindow(QtGui.QDialog): return self.altCoverWidget.setIssueID( self.currentMatch()['issue_id'] ) + if self.currentMatch()['description'] is None: + self.teDescription.setText ( "" ) + else: + self.teDescription.setText ( self.currentMatch()['description'] ) def setCoverImage( self ): ca = self.current_match_set.ca diff --git a/comictaggerlib/comicvinecacher.py b/comictaggerlib/comicvinecacher.py index bb05f3c..c0e4146 100644 --- a/comictaggerlib/comicvinecacher.py +++ b/comictaggerlib/comicvinecacher.py @@ -114,6 +114,7 @@ class ComicVineCacher: "thumb_url TEXT," + "cover_date TEXT," + "site_detail_url TEXT," + + "description TEXT," + "timestamp DATE DEFAULT (datetime('now','localtime')), " + "PRIMARY KEY (id ) )" ) @@ -283,6 +284,7 @@ class ComicVineCacher: "cover_date": issue['cover_date'], "super_url": issue['image']['super_url'], "thumb_url": issue['image']['thumb_url'], + "description": issue['description'], "timestamp": timestamp } self.upsert( cur, "issues" , "id", issue['id'], data) @@ -338,7 +340,7 @@ class ComicVineCacher: # fetch results = list() - cur.execute("SELECT id,name,issue_number,site_detail_url,cover_date,super_url,thumb_url FROM Issues WHERE volume_id = ?", [ volume_id ] ) + cur.execute("SELECT id,name,issue_number,site_detail_url,cover_date,super_url,thumb_url,description FROM Issues WHERE volume_id = ?", [ volume_id ] ) rows = cur.fetchall() # now process the results @@ -353,6 +355,7 @@ class ComicVineCacher: record['image'] = dict() record['image']['super_url'] = row[5] record['image']['thumb_url'] = row[6] + record['description'] = row[7] results.append(record) diff --git a/comictaggerlib/comicvinetalker.py b/comictaggerlib/comicvinetalker.py index 83576f1..a2c82b0 100644 --- a/comictaggerlib/comicvinetalker.py +++ b/comictaggerlib/comicvinetalker.py @@ -222,7 +222,7 @@ class ComicVineTalker(QObject): return cached_volume_issues_result #--------------------------------- - issues_url = self.api_base_url + "/issues/" + "?api_key=" + self.api_key + "&filter=volume:" + str(series_id) + "&field_list=id,volume,issue_number,name,image,cover_date,site_detail_url&format=json" + issues_url = self.api_base_url + "/issues/" + "?api_key=" + self.api_key + "&filter=volume:" + str(series_id) + "&field_list=id,volume,issue_number,name,image,cover_date,site_detail_url,description&format=json" content = self.getUrlContent(issues_url) cv_response = json.loads(content) @@ -276,7 +276,7 @@ class ComicVineTalker(QObject): filter = "&filter=" + volume_filter + year_filter + ",issue_number:" + issue_number - issues_url = self.api_base_url + "/issues/" + "?api_key=" + self.api_key + filter + "&field_list=id,volume,issue_number,name,image,cover_date,site_detail_url&format=json" + issues_url = self.api_base_url + "/issues/" + "?api_key=" + self.api_key + filter + "&field_list=id,volume,issue_number,name,image,cover_date,site_detail_url,description&format=json" content = self.getUrlContent(issues_url) cv_response = json.loads(content) diff --git a/comictaggerlib/issueidentifier.py b/comictaggerlib/issueidentifier.py index 986265f..ff9d973 100644 --- a/comictaggerlib/issueidentifier.py +++ b/comictaggerlib/issueidentifier.py @@ -540,6 +540,7 @@ class IssueIdentifier: match['image_url'] = image_url match['thumb_url'] = thumb_url match['page_url'] = page_url + match['description'] = issue['description'] self.match_list.append(match) diff --git a/comictaggerlib/issueselectionwindow.py b/comictaggerlib/issueselectionwindow.py index a7183f9..ec86921 100644 --- a/comictaggerlib/issueselectionwindow.py +++ b/comictaggerlib/issueselectionwindow.py @@ -164,5 +164,10 @@ class IssueSelectionWindow(QtGui.QDialog): if record['id'] == self.issue_id: self.issue_number = record['issue_number'] self.coverWidget.setIssueID( int(self.issue_id) ) + if record['description'] is None: + self.teDescription.setText ( "" ) + else: + self.teDescription.setText ( record['description'] ) + break diff --git a/comictaggerlib/matchselectionwindow.py b/comictaggerlib/matchselectionwindow.py index 416a104..fc5d157 100644 --- a/comictaggerlib/matchselectionwindow.py +++ b/comictaggerlib/matchselectionwindow.py @@ -144,7 +144,11 @@ class MatchSelectionWindow(QtGui.QDialog): return self.altCoverWidget.setIssueID( self.currentMatch()['issue_id'] ) - + if self.currentMatch()['description'] is None: + self.teDescription.setText ( "" ) + else: + self.teDescription.setText ( self.currentMatch()['description'] ) + def setCoverImage( self ): self.archiveCoverWidget.setArchive( self.comic_archive) diff --git a/comictaggerlib/ui/autotagmatchwindow.ui b/comictaggerlib/ui/autotagmatchwindow.ui index e19127c..cc5214c 100644 --- a/comictaggerlib/ui/autotagmatchwindow.ui +++ b/comictaggerlib/ui/autotagmatchwindow.ui @@ -6,21 +6,18 @@ 0 0 - 907 - 507 + 943 + 467 Select Match - + - - 0 - @@ -38,45 +35,73 @@ - - - QAbstractItemView::SingleSelection + + + + 0 + 0 + - - QAbstractItemView::SelectRows + + Qt::Vertical - - 0 - - - 4 - - - true - - + false - - - - Series + + + + + 0 + 7 + - - - - Publisher + + QAbstractItemView::SingleSelection - - - - Date + + QAbstractItemView::SelectRows - - - - Title + + 0 - + + 4 + + + true + + + false + + + + Series + + + + + Publisher + + + + + Date + + + + + Title + + + + + + + 0 + 3 + + + diff --git a/comictaggerlib/ui/issueselectionwindow.ui b/comictaggerlib/ui/issueselectionwindow.ui index 452c774..aaa37d2 100644 --- a/comictaggerlib/ui/issueselectionwindow.ui +++ b/comictaggerlib/ui/issueselectionwindow.ui @@ -6,56 +6,90 @@ 0 0 - 753 - 525 + 872 + 550 Select Issue - + + + 6 + - - - QAbstractItemView::SingleSelection + + + + 0 + 0 + - - QAbstractItemView::SelectRows + + Qt::Vertical - - 0 - - - 3 - - - true - - + false - - - - Issue + + + + + 0 + 7 + - - - - Date + + QAbstractItemView::SingleSelection - - - - Title + + QAbstractItemView::SelectRows - - AlignHCenter|AlignVCenter|AlignCenter + + 0 - + + 3 + + + true + + + false + + + + Issue + + + + + Date + + + + + Title + + + AlignHCenter|AlignVCenter|AlignCenter + + + + + + + 0 + 3 + + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + diff --git a/comictaggerlib/ui/matchselectionwindow.ui b/comictaggerlib/ui/matchselectionwindow.ui index e19127c..cc5214c 100644 --- a/comictaggerlib/ui/matchselectionwindow.ui +++ b/comictaggerlib/ui/matchselectionwindow.ui @@ -6,21 +6,18 @@ 0 0 - 907 - 507 + 943 + 467 Select Match - + - - 0 - @@ -38,45 +35,73 @@ - - - QAbstractItemView::SingleSelection + + + + 0 + 0 + - - QAbstractItemView::SelectRows + + Qt::Vertical - - 0 - - - 4 - - - true - - + false - - - - Series + + + + + 0 + 7 + - - - - Publisher + + QAbstractItemView::SingleSelection - - - - Date + + QAbstractItemView::SelectRows - - - - Title + + 0 - + + 4 + + + true + + + false + + + + Series + + + + + Publisher + + + + + Date + + + + + Title + + + + + + + 0 + 3 + + +