GithubHelp home page GithubHelp logo

buzz / flicks Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 4.0 4.01 MB

Personal movie database

License: GNU General Public License v2.0

Python 56.94% CSS 5.73% JavaScript 30.45% HTML 6.72% Ruby 0.16%

flicks's Introduction

Flicks

Flicks is a web application for movie collectors. It consists of

  • A thin REST back-end implemented using Django
  • A user interface implemented using HTML5/Backbone

Features

  • IMDb integration
  • Grid and tile view
  • Movie statistics
  • Search
  • Extensive filtering
  • Automatic cover fetching
  • Media file meta data parsing

Screenshots

Grid view

Tile view

Keyword statistics

Added-on statistics

Requirements

Many more dependencies are automatically installed using pip, bower and npm.

Installation

Clone the repository:

$ git clone https://github.com/buzz/flicks.git
$ cd flicks

It is highly recommended to use a Virtualenv to manage Flicks' dependencies:

$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Configuration file

Never edit flicks/settings.py directly! It serves as the default configuration file. You override everything in your own file:

Create configuration file:

$ cp flicks/settings_local.example.py flicks/settings_local.py

Generate and add a SECRET_KEY to your settings_local.py otherwise Django will not start.

You can have a look at flicks/settings.py for a list of other settings.

Database

The database section looks like this on my developer box:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'flicks',
        'USER': 'root',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
        'OPTIONS': {
            'init_command': 'SET storage_engine=MyISAM', # for full-text index!
        },
    }
}

Make sure this database exists and is accessible.

For an installation without a dedicated database server you might try SQLite which is not tested but probably works:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'flicks',
    }
}

Paths

Flicks parses media files and also displays and downloads movie artwork. The following two configuration options set the locations for the movie and image folder:

MOVIES_ROOT = '/path/to/flicks'
COVERS_ROOT = '/path/to/covers'

Note: Flicks stores movies and covers in a particular folder/file structure:

  • MOVIES_ROOT
    Movies are organized in sub-directories:
    MOVIES_ROOT/0000/00XX/ for the entries 1 to 99
    MOVIES_ROOT/0100/01XX/ for the entries 100 to 199 and so forth…
    Each directory contains all files related to one entry.
  • COVERS_ROOT follows a simple format:
    COVERS_ROOT/movies_N.jpg, where N is the movie ID without leading zeros.

The directory structure is important to know but Flicks is actually organizing this for you.

Set-up database

To initialize the database, type:

$ ./manage.py syncdb

To migrate all database tables:

$ ./manage.py migrate

Build front-end

Now everything is setup so your computer can run the Flicks back-end. The actual user interface is built with HTML5 and Backbone/Marionette. The project is managed using grunt:

$ cd flicksfrontend
$ bower install
$ npm install
$ grunt dist

The grunt dist command should generate the web app files in the dist folder.

Note: You can use grunt dev to start a server for front-end developing on port 7000.

Create symlink for covers

After building the front-end you need to create a symlink to the covers:

$ cd dist/static
$ ln -s COVERS_ROOT .

Note: Replace COVERS_ROOT with the actual path to the covers folder.

Run Flicks

You can start Flicks by using the following command:

$ ./manage.py runserver_plus

Fire up a browser and point it to http://localhost:8000/.

Management tools

Sync' with IMDb

Sync' all movies with IMDb that haven't been sync'd for more than one week:

$ ./manage.py imdb_sync

Note: Can also be triggered for single movies in the front-end.

Import from local directory

Import movies from SRC_DIR (single files and directories are interpreted as one movie) to MOVIES_ROOT:

$ ./manage.py import_from_dir SRC_DIR

Note: It greatly enhances IMDb search result quality if movie file names include title and year.

Warning: This script does actually quite a lot and moves data across your file system. So use with care!

This outlines the process:

  • Walks directory tree under SRC_DIR, for each encountered file/directory:
  1. Perform IMDb query based on file name
  2. Let user choose from results or input custom IMDb number
  3. Warns if movie already exists in database
  4. Moves files to correct folder inside MOVIES_ROOT
  5. Sets added_on date field according to file modification time
  6. Triggers IMDb import
  7. Triggers cover import

Note: Media file parsing is not performed here. Look next command for this.

Scan media files

Scan the folder MOVIES_ROOT for media file information using MediaInfo:

$ ./manage.py scan_files

Set added_on field

Scan the folder MOVIES_ROOT and set added_on field according to file modification time.

$ ./manage.py set_added_on_from_file

Import from AMC

Import from Ant Movie Catalog (needs ElementTree):

$ ./manage.py import_amc_xml

Server deployment

This is beyond the scope of this document.

Hosting a Django application is well documented and usually involves running Gunicorn or similar behind a web server like nginx or Apache. This is the way to go if you want to expose Flicks to the Internet and add features like TLS encryption and/or authentication.

License

This product is licensed under the terms of the GNU GENERAL PUBLIC LICENSE Version 2.

Pleaser refer to the LICENSE file for details.

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.