Package: dakarafeeder
Dakara FeederAllows to feed the database of the Dakara server remotely.InstallationThis repo is tied with the Dakara server, so you should setup it first:Dakara server.Other important parts of the project include:Dakara VLC player.System requirementsPython3, to make everything up and running (supported versions: 3.7, 3.8, 3.9, 3.10 and 3.11);ffmpeg, to extract lyrics and extract metadata from files (preferred way);MediaInfo, to extract metadata from files (slower, alternative way, may not work on Windows).Linux and Windows are supported.Virtual environmentIt is strongly recommended to use the Dakara feeder within a virtual environment.InstallPlease ensure you have a recent enough version ofsetuptools:pipinstall--upgrade"setuptools>=46.4.0"Install the package with:pipinstalldakarafeederIf you have downloaded the repo, you can install the package directly with:pipinstall.UsageCommandsThe package provides thedakara-feeder feedcommand for creating data on a running instance of the Dakara server.
Several sub-commands are available.
To begin,dakara-feeder feed songswill find songs in the configured directory, parse them and send their data:dakara-feederfeedsongs# orpython-mdakara_feederfeedsongsOne instance of the Dakara server should be running.The data extracted from songs are very limited in this package by default, as data can be stored in various ways. You are encouraged to make your own parser (seethis sectionfor more details).Then,dakara-feeder feed tagsanddakara-feeder feed work-typeswill find tags and work types in a YAML file (seethis sectionfor more details):dakara-feederfeedtagspath/to/tags.yaml# orpython-mdakara_feederfeedtagspath/to/tags.yamland:dakara-feederfeedwork-typespath/to/work_types.yaml# orpython-mdakara_feederfeedwork-typespath/to/work_types.yamlAlso,dakara-feeder feed workswill find works in a JSON file (seethis sectionfor more details):dakara-feederfeedworkspath/to/works.json# orpython-mdakara_feederfeedworkspath/to/works.jsonFor more help:dakara-feeder-h# orpython-mdakara_feeder-hBefore calling any command, you should create a config file with:dakara-feedercreate-config# orpython-mdakara_feedercreate-configand complete it with your values. The file is stored in your user space:~/.config/dakaraon Linux, or$APPDATA\DakaraProject\dakaraon Windows.ConfigurationThe configuration is created with the previously cited command. Several aspect of the feeder can be configured with this file. Please check with the file documentation.Authentication to the server can be done with username and password, or with a token that can be copied from the web client. Please note that only a library manager can use the feeder.Making a custom parserTo override the extraction of data from song files, you should create a class derived fromdakara_feeder.song.BaseSong. Please refer to the documentation of this class to learn which methods to override, and what attributes and helpers are at your disposal.Here is a basic example. It considers that the song video file is formatted in the way "title - main artist.ext":# my_song.pyfromdakara_feeder.songimportBaseSongclassSong(BaseSong):defget_title(self):returnself.video_path.stem.split(" - ")[0]defget_artists(self):return[{"name":self.video_path.stem.split(" - ")[1]}]To register your customizedSongclass, you simply indicate it in the configuration file.
You can either indicate an importable module or a file:custom_song_class:path/to/my_song.py::Song# orcustom_song_class:my_song.SongNow,dakara-feederwill use your customizedSongclass instead of the default one.Tags and work types fileWhilst data from songs are extracted directly from song files, data from tags and work types are extracted from a YAML file.
All data can coexist in the same file.TagsTags will be searched in the keytags.
Tags are identified by their name (it will be displayed in upper case, it
should be just one word).
You can provide a color hue (positive integer from 0 to 360):tags:-name:PVcolor_hue:162-name:AMVcolor_hue:140Work typesWork types will be searched in the keyworktypesWork types are identified by their query name (hyphenated name, with no special
characters, used as keyword for querying).
You can provide a work type display name (singular and plural) and an icon name (choosen among theFontAwesomefont glyphes):worktypes:-query_name:animename:Animename_plural:Animesicon_name:television-query_name:live-actionname:Live actionname_plural:Live actionsicon_name:filmWorks fileYou can provide more information about works (especially alternative names) from a JSON file.
The file should contain a dictionary where keys are work types query name and values lists of works representation:{"work_type_1":[{"title":"Work 1","subtitle":"Subtitle 1","alternative_titles":[{"title":"AltTitle 1"},{"title":"AltTitle 2"}]},{"title":"Work 2","subtitle":"Subtitle 2"}],"work_type_2":[]}Identification with existing works on the server is made with the work type, the title and the subtitle, case insensitively.DevelopmentPlease read thedevelopers documentation.MIT LicenseCopyright (c) 2022 Dakara ProjectPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.