cleanup
This commit is contained in:
parent
ccb54122cc
commit
f6ed20d87b
4 changed files with 15 additions and 6 deletions
1
README
1
README
|
@ -1 +0,0 @@
|
|||
collection tools to create *cine.ma sites
|
5
README.md
Normal file
5
README.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
# collection tools to create *cine.ma sites
|
||||
|
||||
COUNTRY=in
|
||||
python films_by_country.py $COUNTRY films_$COUNTRY.json
|
||||
python add_metadata.py $COUNTRY films_$COUNTRY.json films_$COUNTRY_metadata.json
|
|
@ -25,13 +25,12 @@ def add_metadata(films, country, output):
|
|||
if info['imdbId'] in known_ids:
|
||||
continue
|
||||
skip = False
|
||||
for key in ('Mini-Series', 'TV Series', 'TV Movie', 'TV Special'):
|
||||
for key in ('Mini-Series', 'TV Series', 'TV Movie', 'TV Special', 'Video Game'):
|
||||
if key in info['title']:
|
||||
skip = True
|
||||
if skip:
|
||||
continue
|
||||
|
||||
extra = api.getMetadata(id=info['imdbId'], keys=[
|
||||
keys = [
|
||||
'language', 'productionCompany', 'director',
|
||||
'runtime', 'alternativeTitles',
|
||||
'color', 'sound',
|
||||
|
@ -39,9 +38,15 @@ def add_metadata(films, country, output):
|
|||
'isSeries',
|
||||
'title',
|
||||
'originalTitle', 'year'
|
||||
])['data']
|
||||
]
|
||||
extra = api.getMetadata(id=info['imdbId'], keys=keys)['data']
|
||||
print info
|
||||
print extra
|
||||
if not extra:
|
||||
save()
|
||||
print 'lets try again'
|
||||
extra = api.getMetadata(id=info['imdbId'], keys=keys)['data']
|
||||
print extra
|
||||
if 'isSeries' in extra or ('country' in extra and not country in extra['country']):
|
||||
info['delete'] = True
|
||||
print 'deleting', info['imdbId'], info.get('title')
|
||||
|
|
|
@ -21,7 +21,7 @@ def load(data_json):
|
|||
reset_table(archive.models.Volume._meta.db_table)
|
||||
reset_table(models.Item._meta.db_table)
|
||||
transaction.commit_unless_managed()
|
||||
os.system('rm -r /srv/pandora/data/files')
|
||||
os.system('rm -r /srv/pandora/data/media')
|
||||
os.system('rm -r /srv/pandora/data/items')
|
||||
|
||||
films = json.load(open(data_json))
|
||||
|
|
Loading…
Reference in a new issue