Top100
Your Personal Movie List (C++17 CLI + library)
|
Persistent container for up to 100 movies, with ranking. More...
#include <top100.h>
Public Member Functions | |
Top100 (const std::string &filename) | |
void | addMovie (const Movie &movie) |
Add a movie; replaces existing title+year duplicates. | |
void | removeMovie (const std::string &title) |
Remove by title (first match). No-op if not found. | |
bool | removeByImdbId (const std::string &imdbID) |
Remove by IMDb ID (preferred precise delete). | |
std::vector< Movie > | getMovies (SortOrder order=SortOrder::DEFAULT) const |
Return a copy of movies in the requested sort order. | |
int | findIndexByImdbId (const std::string &imdbID) const |
int | findIndexByTitleYear (const std::string &title, int year) const |
void | replaceMovie (size_t index, const Movie &movie) |
Replace movie at index (bounds-checked internally). | |
bool | updateMovie (size_t index, const Movie &movie) |
Update movie at index; returns false if index invalid. | |
bool | mergeFromOmdbByImdbId (const Movie &omdbMovie) |
Merge updated metadata into an existing movie by IMDb ID. Copies all metadata fields from the provided OMDb-sourced movie into the stored record identified by imdbID, while preserving userScore/userRank. If the movie is not found, returns false. Saves to disk on success. | |
void | recomputeRanks () |
Recompute 1-based userRank from userScore descending. | |
Persistent container for up to 100 movies, with ranking.
Loads from and saves to a JSON file. Maintains an Elo-like userScore per movie and exposes recomputeRanks() to derive 1-based userRank ordering.
int Top100::findIndexByImdbId | ( | const std::string & | imdbID | ) | const |
int Top100::findIndexByTitleYear | ( | const std::string & | title, |
int | year | ||
) | const |