Permalink
Browse files

Operational fix for Force Update - added Last Updated to detail page

  • Loading branch information...
1 parent 8d234c5 commit 6854500a6e9ee11fe1c52a7e592906a45a994c55 @evilhero committed Oct 7, 2012
Showing with 37 additions and 4 deletions.
  1. +9 −0 data/interfaces/default/artistredone.html
  2. +24 −1 mylar/__init__.py
  3. +2 −1 mylar/importer.py
  4. +2 −2 mylar/updater.py
@@ -78,6 +78,15 @@
<label><big>Status: </big><norm>${comic['Status']}</norm></label>
</div>
<div>
+ <label><big>Last Updated: </big>
+ %if comic['LastUpdated'] is None:
+ <norm>Never</norm>
+ %else:
+ <norm>${comic['LastUpdated']}</norm>
+ %endif
+ </label>
+ </div>
+ <div>
<label><big>Issues in Series: </big><norm>${comic['Total']} issues</norm></label>
</div>
<div>
View
@@ -512,13 +512,36 @@ def dbcheck():
conn=sqlite3.connect(DB_FILE)
c=conn.cursor()
- c.execute('CREATE TABLE IF NOT EXISTS comics (ComicID TEXT UNIQUE, ComicName TEXT, ComicSortName TEXT, ComicYear TEXT, DateAdded TEXT, Status TEXT, IncludeExtras INTEGER, Have INTEGER, Total INTEGER, ComicImage TEXT, ComicPublisher TEXT, ComicLocation TEXT, ComicPublished TEXT, LatestIssue TEXT, LatestDate TEXT, Description TEXT, QUALalt_vers TEXT, QUALtype TEXT, QUALscanner TEXT, QUALquality TEXT)')
+ c.execute('CREATE TABLE IF NOT EXISTS comics (ComicID TEXT UNIQUE, ComicName TEXT, ComicSortName TEXT, ComicYear TEXT, DateAdded TEXT, Status TEXT, IncludeExtras INTEGER, Have INTEGER, Total INTEGER, ComicImage TEXT, ComicPublisher TEXT, ComicLocation TEXT, ComicPublished TEXT, LatestIssue TEXT, LatestDate TEXT, Description TEXT, QUALalt_vers TEXT, QUALtype TEXT, QUALscanner TEXT, QUALquality TEXT, LastUpdated TEXT)')
c.execute('CREATE TABLE IF NOT EXISTS issues (IssueID TEXT, ComicName TEXT, IssueName TEXT, Issue_Number TEXT, DateAdded TEXT, Status TEXT, Type TEXT, ComicID, ArtworkURL Text, ReleaseDate TEXT, Location TEXT, IssueDate TEXT, Int_IssueNumber INT)')
c.execute('CREATE TABLE IF NOT EXISTS sablog (nzo_id TEXT, ComicName TEXT, ComicYEAR TEXT, ComicIssue TEXT, name TEXT, nzo_complete TEXT)')
c.execute('CREATE TABLE IF NOT EXISTS snatched (IssueID TEXT, ComicName TEXT, Issue_Number TEXT, Size INTEGER, DateAdded TEXT, Status TEXT, FolderName TEXT, ComicID TEXT)')
c.execute('CREATE TABLE IF NOT EXISTS upcoming (ComicName TEXT, IssueNumber TEXT, ComicID TEXT, IssueID TEXT, IssueDate TEXT, Status TEXT)')
# c.execute('CREATE TABLE IF NOT EXISTS weekly (SHIPDATE, PUBLISHER text, ISSUE text, COMIC VARCHAR(150), EXTRA text, STATUS text)')
+ #add in the late players to the game....
+ try:
+ c.execute('SELECT LastUpdated from comics')
+ except sqlite3.OperationalError:
+ c.execute('ALTER TABLE comics ADD COLUMN LastUpdated TEXT')
+
+ try:
+ c.execute('SELECT QUALalt_vers from comics')
+ except sqlite3.OperationalError:
+ c.execute('ALTER TABLE comics ADD COLUMN QUALalt_vers TEXT')
+ try:
+ c.execute('SELECT QUALtype from comics')
+ except sqlite3.OperationalError:
+ c.execute('ALTER TABLE comics ADD COLUMN QUALtype TEXT')
+ try:
+ c.execute('SELECT QUALscanner from comics')
+ except sqlite3.OperationalError:
+ c.execute('ALTER TABLE comics ADD COLUMN QUALscanner TEXT')
+ try:
+ c.execute('SELECT QUALquality from comics')
+ except sqlite3.OperationalError:
+ c.execute('ALTER TABLE comics ADD COLUMN QUALquality TEXT')
+
conn.commit()
c.close()
View
@@ -269,7 +269,8 @@ def addComictoDB(comicid):
controlValueStat = {"ComicID": comicid}
newValueStat = {"Status": "Active",
"LatestIssue": latestiss,
- "LatestDate": latestdate
+ "LatestDate": latestdate,
+ "LastUpdated": helpers.now()
}
myDB.upsert("comics", newValueStat, controlValueStat)
View
@@ -28,12 +28,12 @@ def dbUpdate():
activecomics = myDB.select('SELECT ComicID, ComicName from comics WHERE Status="Active" or Status="Loading" order by LastUpdated ASC')
- logger.info('Starting update for %i active comics' % len(activecomicss))
+ logger.info('Starting update for %i active comics' % len(activecomics))
for comic in activecomics:
comicid = comic[0]
- importer.addComictoDB(comicid)
+ mylar.importer.addComictoDB(comicid)
logger.info('Update complete')

0 comments on commit 6854500

Please sign in to comment.