Git Product home page Git Product logo

moviecat's Introduction

moviecat

Lightweight intelligent desktop movie ranking program!

Moviecat uses a binary search version of insertion sort to insert movies into your personal movie list. The program will ask you a series of direct comparison questions where you must compare the movie to another movie in your personal list. After a set amount of questions the program will insert that movie into the found position in your movie list. An example of this in operation is below.

This program will organically build a ranking of every movie you've seen without the requirement for scales. You are freed from having to rate movies on arbitrary scales, like 0-10, or out of 5 stars, or the number of times you'd rather watch Casablanca as compared to each movie. Things like that.

Dependencies

Moviecat should compile just fine without any dependencies, although if you want to actually run it you'll need sqlite. Make sure you also run git submodule update in order to make sure you've downloaded the zip wrapper code.

Upon first startup moviecat will download imdb datasets from https://datasets.imdbws.com. It will download title.basics.tsv.gz, title.crew.tsv.gz and name.basics.tsv.gz When self-updating, moviecat will redownload the datasets to update its internal database. By default this happens if the last update happened more than 4 weeks ago, but this option can be changed in the app.

Compiling moviecat

To compile moviecat run the following:

nim c -d:ssl src/moviecat.nim

Note the change from previous (< 0.4.0) versions with the addition of the -d:ssl flag. This is necessary for moviecat to download the imdb datasets.

For a quicker, but potentially more unstable version you can turn on the -d:release or -d:danger flags. Release binaries are compiled using -d:release.

moviecat requires Nim >= 1.4.2 as it requires db_sqlite procs that were not added until that version.

Example

I have chosen to rank Lady Bird (2017) among a few random classics, since I thought of this program while watching Lady Bird.

What would you like to do?
rank lady bird
Found these movies:
[0] (tt0163050) The Legend of a Lady Bird, 1997
[1] (tt1442194) A Life: The Story of Lady Bird Johnson, 1992
[2] (tt4925292) Lady Bird, 2017
[3] (tt7713508) The Stalker of Lady Bird Lake Part IV: A Location Scouting Film, 2017
Which movie did you want?
2
You have selected (tt4925292) Lady Bird, 2017
Is (tt4925292) Lady Bird, 2017 > (tt0087469) Indiana Jones and the Temple of Doom, 1984?
yes
Is (tt4925292) Lady Bird, 2017 > (tt0062622) 2001: A Space Odyssey, 1968?
yes
Is (tt4925292) Lady Bird, 2017 > (tt0088763) Back to the Future, 1985?
no
What date did you watch this movie? (YYYY-MM-DD)
Input "N" to skip.
2020-06-27
Inserting at rank 2
What would you like to do?
print
[1] (tt0088763) Back to the Future, 1985
[2] (tt4925292) Lady Bird, 2017 (Watched on 2020-06-27)
[3] (tt0062622) 2001: A Space Odyssey, 1968
[4] (tt0082971) Raiders of the Lost Ark, 1981 (Watched on 2020-05-04)
[5] (tt0087469) Indiana Jones and the Temple of Doom, 1984 (Watched on 2020-05-05)
[6] (tt0099088) Back to the Future Part III, 1990
[7] (tt0096874) Back to the Future Part II, 1989

moviecat's People

Contributors

dylanagreen avatar

Stargazers

 avatar

Watchers

 avatar

moviecat's Issues

Refining movie search with writer or directors crashes the program when no people are found.

If you try and search by director or writer and no results are found, the program crashes:

rank blah
Refine search options:
year
director
writer
Input "N" to skip.
director asdf
src/moviecat.nim(79) moviecat
src/parser.nim(72) decrypt_command
src/parser.nim(61) insert_movie
src/parser.nim(54) find_movie
src/parser.nim(42) refine_search
src/search.nim(71) extract_val
/usr/local/nim/lib/system/fatal.nim(54) sysFatal
Error: unhandled exception: index out of bounds, the container is empty [IndexDefect]
Error: execution of an external program failed:

I should handle this by falling back on No director/writer found, and then default to an unrefined search (so return all matches). This is the behaviour that year refinements follow, so we should be consistent (instead of crashing...)

When reranking a movie, the reranking questions do not consider the post-deletion rankings.

If you rank a movie, and then rerank the same movie, it should overwrite the old ranking with the new one, which it does. But when you are performing the ranking, it uses the old database, with the movie included in it. This means that reranking a movie right after ranking it will lead to a different sequence of questions.

In theory this also means that you could possibly have to rank the movie against itself.

Search by director/writer

This is going to be a mild challenge in some ways. Search and ranking by director/writer can be done the same way that it is done by release year. The challenge is that I will need to update imdb.db using the title.crew.tsv file.

Here's what needs to be done:

  • Workflow for updating the movie database from input files on startup (to add new movies not in db)
  • Workflow to import title.crew.tsv to add director/writer information to the database.
  • Search by director/writer
  • print by director/writer

Rework the movie comparison algorithm

Right now the ranking algorithm uses a straight binary search and insertion which is great from an efficiency standpoint but bad from a movie ranking standpoint.

In general I find that people's movie ratings tend to "degrade" over time. That is, people send to move towards either more neutral or more extreme opinions about movie quality the longer away it is from the date they watched the movie. This can lead to what I have discovered in myself as a natural movie inflation. I rarely consider a movie "worse" than the very first question, which is always dead center. This means that I seem to think every movie I watch is above average!

I propose a smarter algorithm to compensate for this effect:

  1. First initial question comparing the to-rank movie with the most recently watched (if watch dates are input) or most recently ranked movie. Worst case effect on ranking: one additional question. Best case effect: reduce the number of questions to 1.
  2. Choose comparison movies using some sort of "similarity" metric. For example, if selecting the middle of the range, select a movie "off-center" if its content is more directly comparable to the input movie. How to define "similar" is an open question, but this should lead to more fair and more accurate personal assessments.

The number of questions indicator is wrong.

When ranking a movie, each questions prints its question number out of the total number of questions. As evidenced by this example, the estimated total number of questions is wrong:

(1/10) Is (tt12718300) Confess, Fletch, 2022 > (tt15679400) Knock at the Cabin, 2023?
n
(2/10) Is (tt12718300) Confess, Fletch, 2022 > (tt14814040) Not Okay, 2022?
y
(3/10) Is (tt12718300) Confess, Fletch, 2022 > (tt8478602) Godzilla: The Planet Eater, 2018?
n
(4/10) Is (tt12718300) Confess, Fletch, 2022 > (tt0103644) Alien³, 1992?
y
(5/10) Is (tt12718300) Confess, Fletch, 2022 > (tt4244994) The Last Duel, 2021?
y
(6/10) Is (tt12718300) Confess, Fletch, 2022 > (tt6217926) Annette, 2021?
n
(7/10) Is (tt12718300) Confess, Fletch, 2022 > (tt0103639) Aladdin, 1992?
y
(8/10) Is (tt12718300) Confess, Fletch, 2022 > (tt0133240) Treasure Planet, 2002?
n
(9/10) Is (tt12718300) Confess, Fletch, 2022 > (tt2381249) Mission: Impossible - Rogue Nation, 2015?
n
What date did you watch this movie? (YYYY-MM-DD)
Input "N" to skip.
2023-03-20

It's probably an off by one error. I suspect that I estimate the number as (n_ranked div 2) + 1 instead of (n_ranked + 1) div 2.

Full Rewrite in a Different Language

Moviecat is relatively old-ish now, a few years at least, and frankly Nim isn't at the level of stability that I'd like for this software. The fact that the sqlite bindings were removed from the stdlib since starting this project in Nim 2.0 should be evidence of that enough, but the longer I remain in nim the older the zip bindings get and the more likely it is that they'll break.

All of this to say, I've been considering and am now leaning towards a full rewrite of moviecat in another language. I'm not sure which yet, but I have been considering Go, Swift, or even just going to Python. I'm leaning away from Python though because I'd like to one day build a proper app, and a lower level language will make that significantly easier.

Unify movie and director/writer search strings

When searching, for example when looking for ranking or when looking for stats, director and writer fields require surrounding the name with quotation marks. Movies, however, do not need to be surrounded by titles. We should move to a unified scheme for search strings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.