Merge pull request #416 from Gluejar/liberalize_linking
I think the answer to my question of whether this should be merged is yes.pull/1/head
commit
9e4c6b9a77
|
@ -1822,9 +1822,9 @@ class Ebook(models.Model):
|
|||
if not url:
|
||||
return None
|
||||
# provider derived from url. returns provider value. remember to call save() afterward
|
||||
if url.startswith('https?://books.google.com/'):
|
||||
if re.match('https?://books.google.com/', url):
|
||||
provider='Google Books'
|
||||
elif url.startswith('http://www.gutenberg.org/'):
|
||||
elif re.match('https?://www.gutenberg.org/', url):
|
||||
provider='Project Gutenberg'
|
||||
elif re.match('https?://(www\.|)archive.org/', url):
|
||||
provider='Internet Archive'
|
||||
|
|
Loading…
Reference in New Issue