Compare commits
No commits in common. "63c37aa3b72fb9a3ded34f0ad4aedd2d811706e8" and "dd2a1a8eab5a6c1221da9b01a12f2b32641ef063" have entirely different histories.
63c37aa3b7
...
dd2a1a8eab
@ -1,3 +1,4 @@
|
||||
from bookstack import Bookstack
|
||||
from wiki_pages import FilmsByCountry, FilmsByReference, FilmsByYear, HiddenThemes, KeywordScores, ViewingsCsv
|
||||
from vcinema_utils import VCinemaUtils
|
||||
|
||||
@ -45,26 +46,45 @@ def update_wiki(token_id, token_secret, update_csv, update_films_by_year, update
|
||||
hidden_themes = HiddenThemes.get_hidden_themes(viewings, token_id, token_secret)
|
||||
bar.next()
|
||||
if update_keyword_scores:
|
||||
keyword_scores = KeywordScores.get_keyword_scores(viewings)
|
||||
keyword_scores = KeywordScores.get_keywordScores(viewings)
|
||||
bar.next()
|
||||
|
||||
bar.finish()
|
||||
|
||||
with IncrementalBar('Generating pages', max=update_page_count, check_tty=False) as bar:
|
||||
if update_films_by_year:
|
||||
films_by_year_page = FilmsByYear.build_page(films_by_year)
|
||||
bar.next()
|
||||
if update_films_by_country:
|
||||
films_by_country_page = FilmsByCountry.build_page(films_by_country)
|
||||
bar.next()
|
||||
if update_film_references:
|
||||
films_by_reference_page = FilmsByReference.build_page(films_by_reference)
|
||||
bar.next()
|
||||
if update_hidden_themes:
|
||||
hidden_themes_page = HiddenThemes.build_page(hidden_themes)
|
||||
bar.next()
|
||||
if update_keyword_scores:
|
||||
keyword_scores_page = KeywordScores.build_page(keyword_scores)
|
||||
bar.next()
|
||||
|
||||
bar.finish()
|
||||
|
||||
with IncrementalBar('Updating pages', max=update_page_count, check_tty=False) as bar:
|
||||
if update_films_by_year:
|
||||
FilmsByYear.update_page(films_by_year)
|
||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, FilmsByYear.PAGE_ID, markdown=films_by_year_page)
|
||||
bar.next()
|
||||
if update_films_by_country:
|
||||
FilmsByCountry.update_page(films_by_country)
|
||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, FilmsByCountry.PAGE_ID, markdown=films_by_country_page)
|
||||
bar.next()
|
||||
if update_film_references:
|
||||
FilmsByReference.update_page(films_by_reference)
|
||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, FilmsByReference.PAGE_ID, markdown=films_by_reference_page)
|
||||
bar.next()
|
||||
if update_hidden_themes:
|
||||
HiddenThemes.update_page(hidden_themes)
|
||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, HiddenThemes.PAGE_ID, markdown=hidden_themes_page)
|
||||
bar.next()
|
||||
if update_keyword_scores:
|
||||
KeywordScores.update_page(keyword_scores)
|
||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, KeywordScores.PAGE_ID, markdown=keyword_scores_page)
|
||||
bar.next()
|
||||
|
||||
bar.finish()
|
||||
|
@ -1,4 +1,3 @@
|
||||
from bookstack import Bookstack
|
||||
from vcinema_utils import VCinemaUtils
|
||||
|
||||
import base64
|
||||
@ -24,11 +23,6 @@ def get_films_by_country(viewings):
|
||||
return viewings_filtered_by_country
|
||||
|
||||
|
||||
def update_page(token_id, token_secret, films_by_country):
|
||||
page = build_page(films_by_country)
|
||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, PAGE_ID, markdown=page)
|
||||
|
||||
|
||||
def build_page(films_by_country):
|
||||
table = build_table(films_by_country)
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
from collections import OrderedDict
|
||||
import string
|
||||
|
||||
from bookstack import Bookstack
|
||||
from vcinema_utils import VCinemaUtils
|
||||
|
||||
# Page ID of https://wiki.jacknet.io/books/vcinema/page/references
|
||||
@ -15,11 +14,6 @@ def get_films_by_reference(viewings):
|
||||
return viewings_filtered_by_reference_keyword
|
||||
|
||||
|
||||
def update_page(token_id, token_secret, films_by_reference_keyword):
|
||||
page = build_page(films_by_reference_keyword)
|
||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, PAGE_ID, markdown=page)
|
||||
|
||||
|
||||
def build_page(films_by_reference_keyword):
|
||||
reference_keywords_sorted = OrderedDict(sorted(films_by_reference_keyword.items(), key=lambda t: t[0]))
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
from collections import OrderedDict
|
||||
|
||||
from bookstack import Bookstack
|
||||
from vcinema_utils import VCinemaUtils
|
||||
|
||||
# Page ID of https://wiki.jacknet.io/books/vcinema/page/films-by-release-year
|
||||
@ -13,11 +12,6 @@ def get_films_by_year(viewings):
|
||||
return viewings_filtered_by_year
|
||||
|
||||
|
||||
def update_page(token_id, token_secret, films_by_year):
|
||||
page = build_page(films_by_year)
|
||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, PAGE_ID, markdown=page)
|
||||
|
||||
|
||||
def build_page(films_by_year):
|
||||
films_by_year_sorted = OrderedDict(sorted(films_by_year.items(), key=lambda t: t[0], reverse=True))
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
from collections import OrderedDict
|
||||
|
||||
from bookstack import Bookstack
|
||||
from vcinema_utils import VCinemaUtils
|
||||
|
||||
# Page ID of https://wiki.jacknet.io/books/vcinema/page/films-by-reference
|
||||
@ -46,11 +45,6 @@ def get_hidden_themes(viewings, token_id, token_secret):
|
||||
return viewings_filtered_watch_date
|
||||
|
||||
|
||||
def update_page(token_id, token_secret, hidden_themes):
|
||||
page = build_page(hidden_themes)
|
||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, PAGE_ID, markdown=page)
|
||||
|
||||
|
||||
def build_page(hidden_themes):
|
||||
hidden_themes = OrderedDict(sorted(hidden_themes.items(), key=lambda t: t[0]))
|
||||
|
||||
|
@ -3,7 +3,6 @@ from progress.bar import IncrementalBar
|
||||
import math
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
from bookstack import Bookstack
|
||||
from imdb_utils import IMDbUtils
|
||||
from vcinema_utils import VCinemaUtils
|
||||
|
||||
@ -26,11 +25,6 @@ def get_keyword_scores(viewings):
|
||||
return viewings_filtered_keyword
|
||||
|
||||
|
||||
def update_page(token_id, token_secret, keyword_data):
|
||||
page = build_page(keyword_data)
|
||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, PAGE_ID, markdown=page)
|
||||
|
||||
|
||||
def add_keyword_totals(keywords, min_vcinema_count):
|
||||
keyword_count = len([keyword for keyword in keywords.keys() if len(keywords[keyword]['vcinema_films']) >= min_vcinema_count])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user