naps / kolekto Goto Github PK
View Code? Open in Web Editor NEWKolekto is a really KISS movie catalog software
License: MIT License
Kolekto is a really KISS movie catalog software
License: MIT License
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
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 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.
TV series management should be easy to implement in Kolekto, todo:
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.
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.
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
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
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
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 {} \;
Exact implementation to be determined...
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}'
}
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....
Somes ideas:
Something like:
command 'import' {
args = '--symlinks'
}
?
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' {}
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:
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").
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.
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]?
It should be nice to get the ability to use show/rm/find-duplicates commands using a symlink to the movies as argument.
Example:
$ kolekto rm ./Testmovie.mkv
^-- Symlink to .kolekto/movies/{hash}
Instead of:
$ kolekto rm {hash}
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
Please find a name which is not already used by another opensource software.
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}'
}
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.