From e1fdfed28186138e46945ba5d9139cf01137d781 Mon Sep 17 00:00:00 2001 From: evilhero Date: Thu, 14 Mar 2013 04:55:38 -0400 Subject: [PATCH] FIX:(#191) Put back the Download-to-local option on details page --- data/interfaces/default/artistredone.html | 17 +++++++++++++++++ mylar/__init__.py | 5 +++++ mylar/webserve.py | 1 + 3 files changed, 23 insertions(+) diff --git a/data/interfaces/default/artistredone.html b/data/interfaces/default/artistredone.html index 71b13c3e..2a1b2fac 100755 --- a/data/interfaces/default/artistredone.html +++ b/data/interfaces/default/artistredone.html @@ -296,6 +296,23 @@ %elif (issue['Status'] == 'Downloaded'): + + %if issue['inCacheDIR']: + <% + try: + with open(os.path.join(mylar.CACHE_DIR,issue['Location'])) as f: + linky = issue['Location'] + except IOError as e: + linky = None + + %> + %if linky: + + %endif + %else: + + %endif + %elif (issue['Status'] == 'Read'): %else: diff --git a/mylar/__init__.py b/mylar/__init__.py index ef85f1de..cd130cf7 100755 --- a/mylar/__init__.py +++ b/mylar/__init__.py @@ -849,6 +849,11 @@ def dbcheck(): except sqlite3.OperationalError: c.execute('ALTER TABLE importresults ADD COLUMN impID TEXT') + try: + c.execute('SELECT inCacheDir from issues') + except sqlite3.OperationalError: + c.execute('ALTER TABLE issues ADD COLUMN inCacheDIR TEXT') + try: c.execute('SELECT inCacheDIR from readlist') except sqlite3.OperationalError: diff --git a/mylar/webserve.py b/mylar/webserve.py index 544a86b8..fa153660 100755 --- a/mylar/webserve.py +++ b/mylar/webserve.py @@ -907,6 +907,7 @@ class WebInterface(object): newValueDict = {'inCacheDIR': 'True', 'Location': issueFILE} myDB.upsert("readlist", newValueDict, controlValueDict) + myDB.upsert("issues", newValueDict, controlValueDict) #print("DB updated - Download link now enabled.")