Giter Club home page Giter Club logo

movielst's People

Contributors

hashhar avatar ichait avatar

Watchers

 avatar  avatar

Forkers

tikki

movielst's Issues

Return former error statement when index is empty

Before we switched over to a database instead of json, if the index file was empty you would see a nice error.
Run movielst PATH to index your movies directory.
This changed because we only checked for if the index file exists, not if it contains entries. With the database we create the file at start if it does not exists.

Now we see :

>movielst

+-------+-------+------+---------+--------+------+
| TITLE | GENRE | IMDB | RUNTIME | TOMATO | YEAR |
+-------+-------+------+---------+--------+------+

Fix current page in navbar links

Currently the navbar is highlighting the "Home" link even if you are on a another page.
To fix, check what page you are on and if true set class active on the link.

Get movie plot

Get the movie plot, a short description of what the movie is about.

OMDb : Plot
TMDb: overview

Get IMDb ID

Get and save IMDb id when indexing movies - can be used for linking to imdb page.

OMDb : imdbID
TMDb : movie_details request -> imdb_id

Cache posters

Cache all posters so they don't need to be downloaded every time you load the web interface.

Check if config file exits

What to do

Check if the config file exits and if not, create the default configuration.

Why?

Currently we only check if the config directory, ~/.movielst/ exists. This causes some issues when we delete the config file and then it is not being created again.

Add personal rating

Be able to add a personal rating to any movie. Should not replace Imdb/rotten tomato score

Move hidden .json and configuration file to folder

What to do?

Make the hidden .json file be located inside a separate folder in the users home directory instead of in the indexed movie folder.

Why?

For know, we don't need to save a hidden file anywhere were the user often looks, there still might be reasons for the user to want to save this file somewhere else. But that is for another issue.
In the home directory there is currently a file named .movielst, this file is responsible to find the hidden .json file above. This issue removes an unnecessary file and makes place for a real configuration file.
Having the hidden .json file inside the home directory will make it easier to make #2 work.

Web TemplateNotFound

When running movielst_web from a fresh install, jinja2 throws an exception.

jinja2.exceptions.TemplateNotFound: home.html

Add file_info to index file

What to do?

Add field file_info to index file, the field should contain file location + name

Why?

Adds a unique key to each entry in the indexed file.
For example, if the indexer guesses the same movie for two different files, we will have someway to tell them apart.

Remove linking to external services for libraries

At the moment, invoking the web interface gets a lot of files from external parties like bootstrap.
These files should probably be downloaded the first time when running web interface and saved in static folder.

Export to excel

What to do?

Add a command to export the indexed list of movies to an excel file. The exported file name should be typed in by the user.

Replace docopt with argparse

What to do?

Remove the docopt dependency and replace it with the builtin argparse.

Why?

There are several reasons why I would like to use argparse instead. First, docopt has not had a stable release since 2014, even though I would not consider the library obsolete (there is still code being pushed to master). Not having a release since a few years back and when there is a working solution included in the standard library the later will be more favorable. Second, the amount of pending pull requests in the docopt repo is ridiculous if the project is still to be considered active.

The usage of argparse will be the same as when using docopt.

Add login_required check on all routes

Routes that needs this implemented :

  • index ('/')
  • settings ('/settings')
  • settings/users ('/settings/users')
  • movie ('/movie')
  • export ('/export/*')
  • api ('/api/*')

Check code :

if not session.get('logged_in') and config.get_setting('Web', 'require_login') == "True":
    return login()
else:

Rotten tomato score is not showing

Rotten tomato score exists with value {"Source":"Rotten Tomatoes","Value":"89%"}, but for some reason it is not being fetched correctly.

OMDb API response for the movie Big Hero 6 -
{"Title":"Big Hero 6","Year":"2014","Rated":"PG","Released":"07 Nov 2014","Runtime":"102 min","Genre":"Animation, Action, Adventure","Director":"Don Hall, Chris Williams","Writer":"Jordan Roberts (screenplay by), Robert L. Baird (screenplay by), Daniel Gerson (screenplay by), Man of Action (Big Hero 6 team and characters created by), Steven T. Seagle (characters), Duncan Rouleau (characters)","Actors":"Scott Adsit, Ryan Potter, Daniel Henney, T.J. Miller","Plot":"The special bond that develops between plus-sized inflatable robot Baymax, and prodigy Hiro Hamada, who team up with a group of friends to form a band of high-tech heroes.","Language":"English","Country":"USA","Awards":"Won 1 Oscar. Another 16 wins & 57 nominations.","Poster":"https://m.media-amazon.com/images/M/MV5BMDliOTIzNmUtOTllOC00NDU3LWFiNjYtMGM0NDc1YTMxNjYxXkEyXkFqcGdeQXVyNTM3NzExMDQ@._V1_SX300.jpg","Ratings":[{"Source":"Internet Movie Database","Value":"7.8/10"},{"Source":"Rotten Tomatoes","Value":"89%"},{"Source":"Metacritic","Value":"74/100"}],"Metascore":"74","imdbRating":"7.8","imdbVotes":"341,041","imdbID":"tt2245084","Type":"movie","DVD":"24 Feb 2015","BoxOffice":"N/A","Production":"Walt Disney Pictures","Website":"http://www.disney.com/BigHero6","Response":"True"}

movielst output -

+--------------+------------------------------+------+---------+--------+------+
| TITLE        | GENRE                        | IMDB | RUNTIME | TOMATO | YEAR |
+--------------+------------------------------+------+---------+--------+------+
| Big Hero 6   | Animation, Action, Adventure | 7.8  | 102 min | -      | 2014 |

This issue has been found in all movies I have tested.

TMDb request crashes if movie not found

Using TMDb API, if the movie could not be found, it crashes.
If the movie could not be found in the TMDb databse, it returns 200 and empty fields,
{ "page": 1, "total_results": 0, "total_pages": 1, "results": [] }

It crashes because we try to assign tem["title"] with something that does not exists.

Traceback (most recent call last): File "/usr/local/bin/movielst", line 11, in <module> load_entry_point('movielst', 'console_scripts', 'movielst')() File "/Users/REDACTED/Documents/movielst/movielst/movielst.py", line 52, in main util(parser.parse_args()) File "/Users/REDACTED/Documents/movielst/movielst/movielst.py", line 70, in util scan_dir(args.PATH, dir_json) File "/Users/REDACTED/Documents/movielst/movielst/movielst.py", line 324, in scan_dir data = get_movie_info(name) File "/Users/REDACTED/Documents/movielst/movielst/movielst.py", line 345, in get_movie_info return get_api(movie_info['title'], None, external_api=get_setting('API', 'use_external_api')) File "/Users/REDACTED/Documents/movielst/movielst/API.py", line 38, in get_api item["title"] = tmdb["results"][0]['title'] IndexError: list index out of range

List index out of range rotten tomatoes

Crashes when running movielst after index, clean installation.

Traceback (most recent call last):
  File "c:\program files (x86)\python36-32\scripts\movielst-script.py", line 11, in <module>
    load_entry_point('movielst', 'console_scripts', 'movielst')()
  File "c:\users\REDACTED\documents\github\movielst\movielst\movielst.py", line 48, in main
    util(parser.parse_args())
  File "c:\users\REDACTED\documents\github\movielst\movielst\movielst.py", line 191, in util
    get_rotten_score(item), item["Year"]])
  File "c:\users\REDACTED\documents\github\movielst\movielst\movielst.py", line 196, in get_rotten_score
    if item['Ratings'][1]['Source'] == "Rotten Tomatoes":
IndexError: list index out of range

PLATFORM : Windows10
PYTHON VERSION : Python 3.6.3

Rework api status checks

In API_util.py we check for http status code, the return statements for any thing not code 200 needs to be changed so it does not return None. Would rather have it return something meaningful with a reason.

If status 401 is returned for either OMDb or TMDb there will still be parsable json to read to determent what went wrong, invalid api key, wrong url or other error.

If an error like a 503 occurs, stop the indexing and return proper statement.

Add ability to edit index from the command line

What to do?

Add an argument like for exampel, -e, --edit to list every entry in index and then let the user be able to select one of them and edit the containing information.

Why?

Sometimes the indexer guesses the movie wrong and it would be nicer to correct it directly inside the program.

Saving settings not updating fields

When saving a setting, the changed field returns back and when refreshing the page the new change is then shown.

Possible fix :
Add redirect to settings page when successful save of configuration is done.

Add web interface

A web interface should be complimentary to the cli and not a replacement. You should still be able to do everything in the cli as well as in the web interface.

Open config with command

What to do?

Add a command that opens up the config file in the default editor.
movielst -ec : movielst --edit-config

Needs to be cross-platform compatible.

Use SQLite instead of json for index

  • First stage :
    Write index to sqlite database file and export to json file. During this stage movielst will still read from the json file.

  • Second stage :
    movielst will read from the sqlite database file and we will no longer use json for index file.

Implement logging

What to do?

Replace every error handling that prints out the error to the console to instead log it with an event logger, https://docs.python.org/3/library/logging.html

Why?

Having a log file will make finding bugs easier, it will also make it so we can output friendly information to the user while still giving the developer enough to debug.

Skip indexing if already exists

What to do?

Make it so when indexing it skips every entry that already exists.
add --force argument to force a reindex of everything like it does now.

Why?

It will make it faster to reindex folder when you have added content to it.

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.