Giter VIP home page Giter VIP logo

kolekto's People

Contributors

nadley avatar naps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kolekto's Issues

Delete "Collection" word in the name of collections

With config:

view 'Collections' {
    pattern = '{collection}/{title}.{ext}'
}

The result:

Collections/<Collection A> Collection/<movie A1>.avi
Collections/<Collection A> Collection/<movie A2>.avi
Collections/<Collection B> Collection/<movie B1>.avi
Collections/<Collection B> Collection/<movie B2>.avi

We could imagine a new config syntax:

view 'Collections' {
    pattern = '{collection_name}/{title}.{ext}'
}

Which give:

Collections/<Collection A>/<movie A1>.avi
Collections/<Collection A>/<movie A2>.avi
Collections/<Collection B>/<movie B1>.avi
Collections/<Collection B>/<movie B2>.avi

Auto mode : generate list of files with no results

The purpose of this enhancement is to generate a list of files which kolekto was not able to import. Actually this information is print on stdout, if I import 1000 files reading my shell history a log file with summary should be enough.

Error management in TMDB-Proxy

Error management in TMDB-Proxy is currently a little too simple and any error reported by the TMDB API (such as a 404) will produce an HTTP 500 error to Kolekto. This should be improved to at least report 4xx errors.

Handle series

TV series management should be easy to implement in Kolekto, todo:

  • Choose a website with API to get metadata
  • Create a profile system (movies and series)
  • Rethink the backend API to handle series specificities (series name, episode number etc)
  • Attachment system for subtitles (can be reused with movies)

Respect former file path

Can you avoid duplication (hardlink, symlink, copy) of imported files and use the former path?

This allow to plug kub easily on an existing database without be locked on this software.

Ability to get the last "n" imported movies

It would be nice to have the ability to create a view that show the last "n" imported movies. This change is not trivial, we have to store the importation date, and have the ability to express this view pattern syntax.

Enter manually informations => TypeError: argument of type 'type' is not iterable

With ArchLinux, python 2.7.6, Kolekto 1.2 from AUR (https://aur.archlinux.org/packages/kolekto/).

$ kolekto import --symlink big.buck.bunny.ogg 
Title to search [big.buck.bunny]? big buck bunny
Please choose the relevant movie for the file: big.buck.bunny.ogg

[1] Big Buck Bunny (2008) by Sacha Goedegebure [tmdb_proxy]
[2] Enter manually informations
[3] None of these

Choice [1-3]? 2
Traceback (most recent call last):
  File "/usr/bin/kolekto", line 85, in <module>
    main()
  File "/usr/bin/kolekto", line 78, in main
    args.command(args, config)
  File "/usr/lib/python2.7/site-packages/kolekto/commands/importer.py", line 112, in run
    self._import(mdb, mds, args, config, filename)
  File "/usr/lib/python2.7/site-packages/kolekto/commands/importer.py", line 152, in _import
    movie = mds.refresh(movie)
  File "/usr/lib/python2.7/site-packages/kolekto/datasources/__init__.py", line 72, in refresh
    refreshed = datasource.refresh(movie)
  File "/usr/lib/python2.7/site-packages/kolekto/datasources/tmdb.py", line 178, in refresh
    if '_tmdb_id' in movie:
TypeError: argument of type 'type' is not iterable

OSError: [Errno 2] No such file or directory: '[...]/.kolekto/movies/[SHA1]'

With ArchLinux, python 2.7.6, last Kolekto from git (commit 77f348f). I use symlinks.

$ kolekto -d -V stats
[debug] Executing command <bound method Stats.run of <kolekto.commands.stats.Stats object at 0x1b18d90>>
Traceback (most recent call last):
  File "/usr/bin/kolekto", line 85, in <module>
    main()
  File "/usr/bin/kolekto", line 78, in main
    args.command(args, config)
  File "/usr/lib/python2.7/site-packages/kolekto/commands/stats.py", line 61, in run
    total_size += os.path.getsize(movie_fullpath)
  File "/usr/lib/python2.7/genericpath.py", line 49, in getsize
    return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: '[...]/.kolekto/movies/b45cd3bc48c91e84b6758fe805cb5f609f7ffb1e'

The tree:

$ tree -a
.
└── .kolekto
    ├── config
    ├── metadata.db
    └── movies
        ├── b45cd3bc48c91e84b6758fe805cb5f609f7ffb1e -> ../Movies/movie.1.avi
        └── b997d57d4c5f01e28b8745e520c42280a00f4939 -> ../Movies/movie.2.avi
2 directories, 4 files

Missing dependancies on Debian package

I don't know if you are the Debian packager but after installing on wheezy the last version with the repo of the README. I got this error :

kolekto init
Traceback (most recent call last):
  File "/usr/local/bin/kolekto", line 75, in <module>
main()
  File "/usr/local/bin/kolekto", line 46, in main
command_class = entrypoint.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
 File "/usr/local/lib/python2.7/dist-packages/kolekto/commands/restore.py", line 6, in <module>
from kolekto.db import MoviesMetadata
File "/usr/local/lib/python2.7/dist-packages/kolekto/db.py", line 2, in <module>
import gdbm
ImportError: No module named gdbm

After a small apt-get install python-gdbm everything seems to works

Remove empty directories in views

When (un)linking it may be interesting to test if a directory is empty then remove it to keep "views" as clean as possible.

Currently I run this command on views:

find ./ -type d -exec rmdir --ignore-fail-on-non-empty {} \;

[bug] UTF-8 in config file

With ArchLinux, python 2.7.6, Kolekto 1.1 from AUR (https://aur.archlinux.org/packages/kolekto/).

$ kolekto config
Traceback (most recent call last):
  File "/usr/bin/kolekto", line 75, in <module>
    main()
  File "/usr/bin/kolekto", line 68, in main
    args.command(args, config)
  File "/usr/lib/python2.7/site-packages/kolekto/commands/config.py", line 17, in run
    config = printer.edit(fconfig.read())
  File "/usr/lib/python2.7/site-packages/kolekto/printer.py", line 141, in edit
    ftmp.write(text.encode('utf-8'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 199: ordinal not in range(128)

In config file:

view 'Année' {
    pattern = '{year|"inconnue"}/{title}.{ext}'
}

No problem with:

view 'Annee' {
    pattern = '{year|"inconnue"}/{title}.{ext}'
}

Adding filtering to avoid some file analysis

In my case I have something like this :

Folder
   - MyMovieTitle.mkv
   - MyMovieTitle.nfo

When I launch kolekto to import content of this folder, I got two entries on .kolekto/movies. First one is pointing on .mkv file, the other one is pointing on .nfo file.

That should be cool if we can have filter parameter in config to avoid indexing of crapy files like : nfo, srt, jpg....

Enhance the view pattern syntax

Somes ideas:

  • Field alternatives, eg: {title_fr|title} -> take title_fr, and if not present, take title (already implemented in commit a716196)
  • Default value in field alternative, eg: {favorite|"Not faves"}
  • Transformation flags, eg: {title:lower}

[bug] Exception: Bad datasource u't'

With ArchLinux, python 2.7.6, Kolekto 1.1 from AUR (https://aur.archlinux.org/packages/kolekto/).

$ kolekto -d -V import --symlink ../mobies/movie.avi 
[debug] Executing command <bound method Import.run of <kolekto.commands.importer.Import object at 0xc44990>>
Traceback (most recent call last):
  File "/usr/bin/kolekto", line 75, in <module>
    main()
  File "/usr/bin/kolekto", line 68, in main
    args.command(args, config)
  File "/usr/lib/python2.7/site-packages/kolekto/commands/importer.py", line 58, in run
    mds = MovieDatasource(config.subsections('datasource'), args.tree)
  File "/usr/lib/python2.7/site-packages/kolekto/datasources/__init__.py", line 56, in __init__
    raise Exception('Bad datasource %r' % datasource_config.args[0])
Exception: Bad datasource u't'

Datasource config:

datasource 'tmdb_proxy' {
    base_url = 'http://api.kolekto-project.org/'
    max_results = 2
}
datasource 'mediainfos' {}

Implement edit command

An edit command could be useful to edit a movie without pain. Currently, the only way to do that is to program in Python using the MoviesMetadata API.

Usage example:

  1. $ kolekto edit
  2. Load the metadata from DB
  3. Start an $EDITOR for metadata edition (JSON ok imho)
  4. When the editor quit, save the metadata to the DB

Handle unknown movies on refresh with TMDB Backend

Sometime movies are deleted on TMDB, so the identifier bound to a movie ("_tmdb_id") in the metadata db is not more valid. This is a problem while an update for the TMDB Backend. The current behavior is to stop the update and print a too vague error to the user (like "Unable to get URL").

  1. This problem should not stop an update.
  2. A more explicit warning should be printed to the user saying that the movies doesn't exists.
  3. A mechanism on the backends API must be implemented to print this warning.

Show more infos in search results

Search results are listed this way:

[#] original_title (year) by director [datasource]

It would be useful to add some details like that:

[#] original_title (year) by director [datasource]
    aka "title_us" [us], "title_fr" [fr] and "title_es" [es]
    cast: actor_a, actor_b, actor_c...

with a new config parameter for prefered title's locales (default: user's locale?) and another for number of actors.

Replace separators by spaces in title before searching

Regular words separators (I've tried with dots, dash and underscores) aren't replaced before searching in database. Example:

$ kolekto import big.buck.bunny.ogg 
Title to search [big.buck.bunny]? 
No results to display for the file: big.buck.bunny.ogg
$ kolekto import big.buck.bunny.ogg 
Title to search [big.buck.bunny]? big buck bunny
Please choose the relevant movie for the file: big.buck.bunny.ogg

[1] Big Buck Bunny (2008) by Sacha Goedegebure [tmdb_proxy]
[2] Enter manually informations
[3] None of these

Choice [1-3]? 

kolekto config problem

When i try to configure kolekto i get:

Traceback (most recent call last):
  File "/usr/local/bin/kolekto", line 85, in <module>
    main()
  File "/usr/local/bin/kolekto", line 78, in main
    args.command(args, config)
  File "/usr/local/lib/python2.7/dist-packages/kolekto/commands/config.py", line 17, in run
    config = printer.edit(fconfig.read())
  File "/usr/local/lib/python2.7/dist-packages/kolekto/printer.py", line 145, in edit
    subprocess.Popen([self._editor, ftmp.name]).wait()
  File "/usr/lib/python2.7/subprocess.py", line 709, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1326, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Thanks

No links created for views

With ArchLinux, python 2.7.6, last Kolekto from git (commit 77f348f). I use symlinks.

Before:

$ tree -a
.
└── .kolekto
    ├── config
    ├── metadata.db
    └── movies
        ├── b45cd3bc48c91e84b6758fe805cb5f609f7ffb1e -> ../Movies/movie.1.avi
        └── b997d57d4c5f01e28b8745e520c42280a00f4939 -> ../Movies/movie.2.avi
2 directories, 4 files

Links creation?

$ kolekto -d -V link
[debug] Executing command <bound method Link.run of <kolekto.commands.link.Link object at 0xee7f50>>
 100% [=====...=====] 2 of 2 | Time: 0:00:00
Found 0 links to delete, 0 links to create

After:

$ tree -a
.
└── .kolekto
    ├── config
    ├── metadata.db
    └── movies
        ├── b45cd3bc48c91e84b6758fe805cb5f609f7ffb1e -> ../Movies/movie.1.avi
        └── b997d57d4c5f01e28b8745e520c42280a00f4939 -> ../Movies/movie.2.avi
2 directories, 4 files

Views config:

view 'Titres' {
    pattern = '{title} ({year}).{ext}'
}
view 'Acteurs' {
    pattern = '{cast}/{title} ({year}).{ext}'
}
view 'Qualité' {
    pattern = '{quality}/{title} ({year}).{ext}'
}
view 'Année' {
    pattern = '{year|"inconnue"}/{title}.{ext}'
}
view 'Genre' {
    pattern = '{genres}/{title} ({year}).{ext}'
}
view 'Directeur' {
    pattern = '{directors}/{year} - {title}.{ext}'
}
view 'Titre français' {
    pattern = '{title_fr|original_title} ({year}).{ext}'
}
view 'Collection' {
    pattern = '{collection}/{year} - {title}.{ext}'
}
view 'Score TMDB' {
    pattern = '{tmdb_votes}/{title} ({year}).{ext}'
}
view 'Pays' {
    pattern = '{countries}/{title} ({year}).{ext}'
}
view 'État' {
    pattern = '{watched|"a.voir"}/{title} ({year}).{ext}'
}
view 'Score perso' {
    pattern = '{favorite|crap|"non.note"}/{title} ({year}).{ext}'
}

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.