Skip to content

Commit

Permalink
Merge pull request #1621 from fshowalter/draft
Browse files Browse the repository at this point in the history
add script
  • Loading branch information
fshowalter authored Jan 1, 2025
2 parents 023ac79 + 4eb77e3 commit fd6aa65
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions scripts/reviews_with_no_viewings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from movielog.exports import list_tools
from movielog.repository import api as repository_api
from movielog.utils.logging import logger


def reports_with_no_viewings() -> None:
logger.log("Initializing...")

repository_api.validate_data()

reviews = sorted(repository_api.reviews(), key=lambda review: review.slug)

viewing_dates = list_tools.group_list_by_key(
repository_api.viewings(), key=lambda viewing: viewing.date
)

for review in reviews:
if review.date not in viewing_dates.keys():
logger.log(review.slug)
continue

viewing_imdb_ids = [viewing.imdb_id for viewing in viewing_dates[review.date]]

if review.imdb_id not in viewing_imdb_ids:
logger.log(review.slug)


if __name__ == "__main__":
reports_with_no_viewings()

0 comments on commit fd6aa65

Please sign in to comment.