The goal of this package is to generate an org-file for the upcoming releases given by metal-archives.
This package depends on the following packages:
requestjsonhtalertorg-modeorg-mlhttps://github.com/ndwarshuis/org-ml
The minimum recipe using melpa is the following one:
(use-package metal-archives :ensure t)This packages provide four interactive functions:
metal-archives-retrieve-next-releases: synchronize the database of the upcoming releasesmetal-archives-org-generate-org-from-db: generates an org file containing all the upcoming releases (see here)metal-archives-load-artists-map: load the database of favorite artistsmetal-archives-shopping-list-update: update the shopping list of the upcoming releases for the favorite artists (see here)
A management of favorite artists is implemented in the package. It consists of two parts:
- a database of favorite artits
- an handle which triggers a specific action when a release from the favorite artist is spotted.
The database is a hash table where the key of the element is the artist name and the value the priority stored in the alert format (the incremental priority list: trivial, low, normal, moderate, high, urgent).
The variable metal-archives-artists-map-filename defines the database file.
This file is assumed to be a Tab Separated Value (TSV) file containing two columns (artist, priority).
The helper metal-archives-load-artists-map is provided to load this database.
The helper metal-archives-save-artists-map can be used to also save the updated database into the database file
A final helper is metal-archives-scan-music-directory is provided to extract the artist names from the music directory (identified by the customizable variable metal-archives-music-root-dir).
It is assumed that the music directory first level subdirectories are the artist names.
The handle is defined by metal-archives-favorite-handle.
By default, it is set to metal-archives-favorite-alert.
Of course this handle can be customized.
This package provides two extended features: an org interface and a shopping list management.
This is defined in the file metal-archives-org.el.
The org interface provides a convenient to generate a org file containing all the upcoming releases. This file could be added in the org-agenda file list to monitor the releases
The org interface is controlled by:
- the variable
metal-archives-org-target-filewhich defines the file where all the upcoming releases; - the variable
metal-archives-org-templatewhich defines the template to represent a release node; - the function
metal-archives-org-generate-org-from-dbwhich is filling themetal-archives-org-target-filefrom the already synchronized release database.
This is defined in the file metal-archives-shopping-list.el.
The shopping list management is a refinement of the org interface. The idea of this extension is to provide a convenient way to store in a shopping list only releases of selected artits.
The shopping list management is controlled by:
- the variable
metal-archives-shopping-list-target-filewhich defines the file where the shopping list is stored; - the variable
metal-archives-shopping-list-root-nodewhich defines the title of the root node containing the shopping list; - the function
metal-archives-shopping-list-updatewhich updates the shopping list using a database (stored inmetal-archives-shopping-list-release-to-flush) previously populated.
The variable metal-archives-shopping-list-release-to-flush is a list of releases as defined in the structure metal-archives-entry from metal-archives.el.
For perfomance constrained, it is advises to select a dedicated shopping list target file as the whole file is currently parsed.
Finally, to simplify the population of the shopping list, a hook as been defined and can be set to the metal-archives-favorite-handle.
This hook is named metal-archives-shopping-list-add-release-and-alert
A close setup to what I am using is the following:
(use-package metal-archives-shopping-list
:ensure t
:commands (metal-archives-shopping-list-update)
:hook
(kill-emacs . metal-archives-shopping-list-update)
(after-init . metal-archives-load-artists-map)
:init
(add-to-list 'org-agenda-files metal-archives-shopping-list-target-file)
:config
(setq metal-archives-favorite-handle 'metal-archives-shopping-list-add-release-and-alert))