mozzo1000 / movielst Goto Github PK
View Code? Open in Web Editor NEW:movie_camera: Everything about your movies within the command line.
License: Other
:movie_camera: Everything about your movies within the command line.
License: Other
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 |
+-------+-------+------+---------+--------+------+
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 the movie plot, a short description of what the movie is about.
OMDb : Plot
TMDb: overview
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 all posters so they don't need to be downloaded every time you load the web interface.
Add a configuration option for the port used by the flask web server.
Default port : 5000
Check if the config file exits and if not, create the default configuration.
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.
Be able to add a personal rating to any movie. Should not replace Imdb/rotten tomato score
Make the hidden .json
file be located inside a separate folder in the users home directory instead of in the indexed movie folder.
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.
When running movielst_web
from a fresh install, jinja2 throws an exception.
jinja2.exceptions.TemplateNotFound: home.html
Add a dropdown button that exports the index to either excel or csv.
Hi,
Problem:
the project is using requests but doesn't declare it as a dependency, so in a clean environment the app doesn't work after running pip install movielst
.
Proposed fix:
Add requests as a dependency.
Add field file_info
to index file, the field should contain file location + name
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.
Add the ability to delete existing index database.
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.
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.
Remove the docopt
dependency and replace it with the builtin argparse
.
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 the dependencies required for the web interface to the list in the README.md
Dependencies :
flask
Flask-WTF
Routes that needs this implemented :
Check code :
if not session.get('logged_in') and config.get_setting('Web', 'require_login') == "True":
return login()
else:
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.
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
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
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 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.
Sometimes the indexer guesses the movie wrong and it would be nicer to correct it directly inside the program.
In the web interface, display a default "no poster" image instead of nothing when there is no poster url in the index.
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.
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.
Add a command that opens up the config file in the default editor.
movielst -ec
: movielst --edit-config
Needs to be cross-platform compatible.
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.
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
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.
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.
It will make it faster to reindex folder when you have added content to it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.