Giter Club home page Giter Club logo

rookit-core's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar jpdsousa avatar

Stargazers

 avatar

Watchers

 avatar  avatar

rookit-core's Issues

Store track formats hits

Description

When a track is parsed with a certain format, store such information in the database, in the form of:
{value: String, occurrences: Integer}

  • value: the format's string value;
  • occurrences: the number of times the format has been picked for parsing

Score

Similar to the field, formats affect the parsing score, based on the number of occurrences.

Playlist Support

Static playlists

Basic list of tracks.

Options

  • create
  • list
  • delete
  • intersect with playlist: e.g. get all tracks present both in playlists A & B in one (temporary) playlist
    • provide the additional option to output the result to a new playlist
  • unite with playlist: e.g. get all tracks present from playlists A & B in one (temporary) playlist
    • provide the additional option to output the result to a new playlist

Insert audio content in the database

One of the key features of Rookit is the ability to write audio source files directly into the database.

Input

Users can select either a file or a folder.

Process

  • Files are parsed one by one, allowing the user to select the best match according to the file name and file tags.

Output

The output is a set of java objects:

  • A Track object containing the track metadata;
  • An Album object with the album metadata in which the track is contained;
  • An optional set of genres, in case any in present;
  • The audio content, which is loaded into MongoDB's GridFS

Feed

Rookit Feed

The rookit feed provides a feed with the latest tracks added. This can be implemented by querying the database for the latest tracks added.

One other possible perspective is to get the latest tracks by release date.

RSS Feed

As an extension, rookit might support RSS feeds.

Support for custom database drivers

At this point Rookit only works with Smof (i.e. MongoDB), through the rookit-mongodb project. It would, however, be interesting to support other database drivers, by generalizing the driver interface.

This issue is related with #3

Planning support for:

  • SQLite
  • H2
  • PostgreSQL

Note: since we are planning to support multiple RDBMSs, it would be cool to investigate integration with Hibernate.

BiStream sources:

  • File (done)
  • MongoDB's GridFS (in progress)
  • Dropbox
  • Google Drive
  • HDFS

Export feature

Allow Rookit to export data from the database as audio files.

Options

Users can export:

  • Tracks: Export all selected tracks;
  • Artists: Export all artist's tracks;
  • Albums: Export all album's tracks;
  • Playlists: Export all playlist's tracks

Export formats:

  • Zip - The content is stored in a zip/gz/tar/rar file;
  • Folder - The content is stored inside the selected filesystem, inside a dedicated folder;
  • Single audio file - The content is written to a single audio file, where the connection between tracks can be parameterized (e.g fade in/out)
  • Playlist File - (e.g. m3u) TBD
  • Custom - Other export formats should be easily supported

Import Version then Original ignores Original

Consider this scenario:

  • Empty database
  • v(x) -> version Track of Track x
  • Y = v(X)
  • User inserts Y
    • X is created with no path
  • User inserts X (with a valid path)
    • the path is not stored, as X already exists in the database.

This behavior is wrong, as one would expect that the path is to be updated with the new insertion. Although, if this behavior is generalized, then the path will always be overwritten, leaving a lot of audio sources as 'dead references'.

Solutions

  • Perform a read operation on the existent track, and if the track's path is NULL then update the track with a new path: SO

Default configuration

Provide a default configuration for every parameter, to avoid missing or invalid configurations.

Parsing configurations

Provide an additional parsing configuration to:

  • Filter results with negative scores;
  • Options for parsing hooks:
    • On Success:
      • Remove Source: ALWAYS | ASK | NEVER

Application configurations are read from a Json file

There should be an application configuration file, which should be written in JSON format.

Gson or Jackson should be used to parse the configuration file.

Configurations:

  • Database connection
    • Host name
    • Port
    • Database name
  • Parsing
    • Max number of results presented
  • Import audio content
  • Delete source (i.e. delete file after importing into the database)

Shell mode

Being an application, rookit can be initialized with our without parameters

If rookit is initialized with parameters, such parameters are interpreted as a single command, such that when the command is run the application exits.

If rookit is initialized without any parameters, it generates a shell, in which multiple commands can be inputted.

Search for missing media

This feature allows users to search for missing tracks, albums, artists, etc.., which might require fetching data from external sources.

Support for plugins

The basis of this project is to always support plugabillity. So, we should follow an approach on how to plug the multiple pieces (i.e. modules) together.

Guice (current)

Currently, guice is supporting plugabillity through modules. However, the configuration is defined programatically, which represents a limitation for users.

Food for thought

Rookit has its base code divided in multiple projects, which in some perspective can be seen as a basis for plugin support.

Reseach

See: StackOverflow
See: Maven Dependency Plugin and depency:get

Support for third party technologies

Note: Use this issue to suggest new third party services that rookit should support.

SubSonic

Rest API
SubSonic is a server that runs on a user machine, giving the user the possibility of streaming its own content to any device installed with a subsonic client.

Plugins

  • [Audio] Connect Rookit to the subsonic server and use it as a streaming service;
  • [DataSource] Connect Rookit to the subsonic server and use it as a metadata source;
  • [DataSink] Connect Subsonic to Rookit and allow SubSonic users to stream from Rookit;

Emby

Emby
Java API
Emby is similar to SubSonic, such that it acts as a media streaming server that runs on the user machine (where the media is located) and is able to stream it to a device that runs an Emby Client. Emby differs from SubSonic as it also supports other types of media apart from music.

Plugins

Due to the similarity with subsonic, the same plugins apply:

  • [Audio] Connect Rookit to the Emby server and use it as a streaming service;
  • [DataSource] Connect Rookit to the Emby server and use it as a metadata source;
  • [DataSink] Connect Emby to Rookit and allowEmby users to stream from Rookit;

Other

Import Automatically

Create a new option for Import that automatically selects the first choice in every parsing.

Configuration Management

The configuration system will be divided in three layers:

  • Interface - A layer which should be mostly composed of interfaces, with which users interact, and which provide a predefined set of options (through methods);
  • Connection - A layer that maps each option method to a dynamic property. This layer is really useful ease the pain of memorizing available options. This layer is also the connection between the Interface and Source layers;
  • Source - This layer acts as a reader, and each implementation should provide reading capabilities for a single type of configuration source (e.g. properties, yaml, json, database). For some sources, there are some libraries which can be used, thus leaving the sole need for an adapter (e.g. config).

RookitQueryLanguage

Descrition

The rookit query language allows users to query the database. The initial idea is to support a querying system from the shell, built upon ExtendedCLI. As such, a list of options are required:

  • -q - [required] - The Query String, which needs to be wrapped around quotes if contains spaces (does ExtCLI support this?)
  • -t - [optional] - The Type of element the user is looking for
    • Artist, Album, Track or Genre

Future Features

  • Random searches for a random element.
  • Surprise me relies on plays and other statistics to choose an element to be played.

Drawbacks

  • Does not support advanced querying options.

Alternaive Querying Methods

  • JSON
    • MongoDB query
  • XML
  • ProtoBuf

Detect versions automatically

Description

It often appends that a track that represents a version of another track (e.g. cover, remix) has no information specifying so.

Idea

When a song is imported, in order to detected possible versions:

  • Search for the track name
    • If a similar name exists, ask the user whether one of the tracks is a version from the other (this can obviously work both ways;
  • In order to reduce overhead, search only when the imported track is (apparently) marked as an original track

Error parsing file

Description

Name: 6LACK - Prblms (it's different & Kivnon Remix)
Database State: empty
Error: deserialization of enum value in track (i.e. TypeVersion)
Hint: somewhere in the track insertion -> onInsertSuccess -> update query

Stack Trace

Exception in thread "main" org.smof.exception.SmofException: java.lang.RuntimeException: Cannot parse value for type: version_token
	at org.smof.parsers.AbstractBsonParser.handleError(AbstractBsonParser.java:53)
	at org.smof.parsers.AbstractBsonParser.fromBson(AbstractBsonParser.java:113)
	at org.smof.parsers.SmofParser.fromBson(SmofParser.java:129)
	at org.smof.parsers.SmofParser.fromBson(SmofParser.java:122)
	at org.smof.parsers.ObjectParser.buildObject(ObjectParser.java:310)
	at org.smof.parsers.ObjectParser.toObject(ObjectParser.java:271)
	at org.smof.parsers.ObjectParser.fromBson(ObjectParser.java:211)
	at org.smof.parsers.SmofParser.fromBson(SmofParser.java:111)
	at org.smof.collection.SmofCollectionImpl.execUpdate(SmofCollectionImpl.java:150)
	at org.smof.collection.SmofUpdateQuery.execute(SmofUpdateQuery.java:85)
	at org.smof.collection.SmofUpdateQuery.idEq(SmofUpdateQuery.java:81)
	at org.smof.collection.SmofUpdateQuery.idEq(SmofUpdateQuery.java:76)
	at org.smof.collection.SmofDispatcher.onInsertSuccess(SmofDispatcher.java:139)
	at org.smof.collection.SmofDispatcher.insert(SmofDispatcher.java:121)
	at org.smof.parsers.ObjectParser.fromElement(ObjectParser.java:138)
	at org.smof.parsers.ObjectParser.toBson(ObjectParser.java:81)
	at org.smof.parsers.SmofParser.toBson(SmofParser.java:164)
	at org.smof.parsers.ObjectParser.fromMap(ObjectParser.java:200)
	at org.smof.parsers.ObjectParser.toBson(ObjectParser.java:84)
	at org.smof.parsers.SmofParser.toBson(SmofParser.java:164)
	at org.smof.parsers.ObjectParser.fromObject(ObjectParser.java:154)
	at org.smof.parsers.ObjectParser.toBson(ObjectParser.java:89)
	at org.smof.parsers.SmofParser.toBson(SmofParser.java:164)
	at org.smof.parsers.ObjectParser.fromMap(ObjectParser.java:200)
	at org.smof.parsers.ObjectParser.toBson(ObjectParser.java:84)
	at org.smof.parsers.SmofParser.toBson(SmofParser.java:164)
	at org.smof.parsers.ObjectParser.fromObject(ObjectParser.java:154)
	at org.smof.parsers.ObjectParser.fromMasterField(ObjectParser.java:124)
	at org.smof.parsers.ObjectParser.toBson(ObjectParser.java:72)
	at org.smof.parsers.SmofParser.toBson(SmofParser.java:136)
	at org.smof.collection.SmofCollectionImpl.replace(SmofCollectionImpl.java:164)
	at org.smof.collection.SmofCollectionImpl.insert(SmofCollectionImpl.java:107)
	at org.smof.collection.SmofDispatcher.insert(SmofDispatcher.java:118)
	at org.smof.collection.SmofDispatcher.insert(SmofDispatcher.java:109)
	at org.smof.collection.Smof.insert(Smof.java:322)
	at org.rookit.mongodb.DBManagerImpl.addAlbum(DBManagerImpl.java:142)
	at org.rookit.runner.actions.ImportAction.handleResult(ImportAction.java:77)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.Iterator.forEachRemaining(Iterator.java:116)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at org.rookit.runner.actions.ImportAction.importDirectory(ImportAction.java:53)
	at org.rookit.runner.actions.ImportAction.execute(ImportAction.java:45)
	at org.extendedCLI.command.AbstractCommand.execute(AbstractCommand.java:40)
	at org.extendedCLI.command.ExtendedCLI.execute(ExtendedCLI.java:29)
	at org.rookit.runner.RookitShell.execute(RookitShell.java:57)
	at org.rookit.runner.RookitShell.start(RookitShell.java:67)
	at org.rookit.runner.RookitShell.main(RookitShell.java:81)
Caused by: java.lang.RuntimeException: Cannot parse value for type: version_token
	... 55 more
Caused by: org.bson.BsonInvalidOperationException: No enum constant org.rookit.dm.track.TypeVersion.
	at org.smof.bson.codecs.string.EnumCodec.decode(EnumCodec.java:34)
	at org.smof.bson.codecs.string.EnumCodec.decode(EnumCodec.java:10)
	at org.smof.parsers.AbstractBsonParser.deserializeWithCodec(AbstractBsonParser.java:124)
	at org.smof.parsers.AbstractBsonParser.fromBson(AbstractBsonParser.java:111)
	... 54 more

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.