Browse Source

Fix py-unrar2 on unix to handle different date formats output by different unrar command line versions.

Fix an indentation typo.
Update HACKS.txt.
pull/530/head
JackDandy 10 years ago
parent
commit
24b1e193aa
  1. 1
      CHANGES.md
  2. 1
      HACKS.txt
  3. 14
      lib/unrar2/unix.py

1
CHANGES.md

@ -45,6 +45,7 @@
* Change disable ToTV due to non-deletable yet reported hacker BTC inbox scam and also little to no new content listings
* Fix Episode View KeyError: 'state-title' failure for shows without a runtime
* Update py-unrar2 library 99.3 to 99.6 (2fe1e98)
* Fix py-unrar2 on unix to handle different date formats output by different unrar command line versions
[develop changelog]
Enable Alpha Ratio again now that the secure login page over https is fixed

1
HACKS.txt

@ -6,3 +6,4 @@ Libs with customisations...
/lib/requests/packages/urllib3/connectionpool.py
/lib/requests/packages/urllib3/util/ssl_.py
/tornado
/lib/unrar2/unix.py

14
lib/unrar2/unix.py

@ -153,7 +153,7 @@ class RarFileImplementation(object):
data['size'] = int(fields[0])
attr = fields[5]
data['isdir'] = 'd' in attr.lower()
data['datetime'] = time.strptime(fields[3]+" "+fields[4], '%d-%m-%y %H:%M')
data['datetime'] = self.rarcmd_dt(fields[3], fields[4])
data['comment'] = None
data['volume'] = None
yield data
@ -169,13 +169,21 @@ class RarFileImplementation(object):
data['size'] = int(fields[1])
attr = fields[0]
data['isdir'] = 'd' in attr.lower()
data['datetime'] = time.strptime(fields[2]+" "+fields[3], '%d-%m-%y %H:%M')
data['datetime'] = self.rarcmd_dt(fields[2], fields[3])
data['comment'] = None
data['volume'] = None
data['volume'] = None
yield data
i += 1
line = source.next()
@staticmethod
def rarcmd_dt(param_date=time.strftime('%Y-%m-%d'), param_time=time.strftime('%H:%M')):
for str_fmt in '%Y-%m-%d %H:%M', '%Y-%m-%d %H:%M':
try:
return time.strptime('%s %s' % (param_date, param_time), str_fmt)
except ValueError:
pass
return time.strptime('%s %s' % (time.strftime('%Y-%m-%d'), time.strftime('%H:%M')), '%Y-%m-%d %H:%M')
def read_files(self, checker):
res = []

Loading…
Cancel
Save