User:Mineo: Difference between revisions
From MusicBrainz Wiki
Jump to navigationJump to search
No edit summary |
|||
(17 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
[http://musicbrainz.org |
[http://musicbrainz.org/user/Mineo My MBz profile] |
||
== Websites with catalogues of classical music == |
=== Websites with catalogues of classical music === |
||
[http://www.bielekat.info Bielekat] |
[http://www.bielekat.info Bielekat] |
||
[http://www.klassikakzente.de Klassikakzente] |
[http://www.klassikakzente.de Klassikakzente] |
||
=== aria2c download list for MB dumps === |
|||
== Editing helpers == |
|||
<pre> |
|||
ftp://mirrors.dotsrc.org/MusicBrainz/data/fullexport/LATEST/mbdump.tar.bz2 ftp://ftp.musicbrainz.org/pub/musicbrainz/data/fullexport/LATEST/mbdump.tar.bz2 |
|||
ftp://mirrors.dotsrc.org/MusicBrainz/data/fullexport/LATEST/mbdump-editor.tar.bz2 ftp://mirrors.dotsrc.org/MusicBrainz/data/fullexport/LATEST/mbdump-editor.tar.bz2 |
|||
ftp://ftp.musicbrainz.org/pub/musicbrainz/data/fullexport/LATEST/mbdump-derived.tar.bz2 ftp://ftp.musicbrainz.org/pub/musicbrainz/data/fullexport/LATEST/mbdump-derived.tar.bz2 |
|||
</pre> |
|||
Those are tabs (\t) separating the URLs, not spaces! |
|||
Replace latest with the real folder name. |
|||
Then save all the URLs to a file and run aria2c like so: |
|||
<pre> |
|||
aria2c -j 6 -i <filename> |
|||
</pre> |
|||
to download the files to the current directory |
|||
==ListenBrainz == |
|||
===submit via curl=== |
|||
<pre>curl -X POST -d @foo.json -H "Authorization: Token aebacb47-a7a2-4b71-ac77-424883c920dc" http://10.1.2.3:8080/1/submit-listens</pre> |
|||
===transform a JSON document from the GET listens API for import=== |
|||
<pre>jq "{listen_type: \"import\", payload: [.payload.listens[]|del(.recording_msid)]}" < foo.json > foo2.json</pre> |
|||
== Picard == |
|||
[https://addons.mozilla.org/en-US/firefox/addon/clippings/ Clippings] is a Firefox addon which "saves and manages frequently-entered text for later pasting into Web page forms" |
|||
For the following to work, you'll need all plugins except cue.py from [https://github.com/mineo/mbstuff/tree/master/picard/plugins my plugin repository]. |
|||
=== Text snippets === |
|||
* Please add this relationship to all the tracks, not to the release (doc:Advanced_Relationship_Style). |
|||
* doc:ClassicalStyleGuide |
|||
* Please provide some evidence that what you are adding has actually been released somewhere. See doc:How_To_Write_Edit_Notes. |
|||
* Moving the relationship to track level |
|||
* Should be on track level |
|||
=== Picard scripting === |
=== Picard scripting === |
||
<pre> |
<pre> |
||
$unset(genre) |
|||
$unset(_rating) |
|||
$unset(bpm) |
|||
$unset(mood) |
|||
$unset(isrc) |
|||
$unset(copyright) |
|||
$unset(lyrics:description) |
|||
$unset(media) |
|||
$unset(catalognumber) |
|||
$unset(barcode) |
|||
$unset(encodedby) |
|||
$unset(releasestatus) |
|||
$unset(asin) |
|||
$unset(script) |
|||
$unset(language) |
|||
$unset(musicip_puid) |
|||
$unset(musicip_fingerprint) |
|||
$unset(composersort) |
|||
$unset(originaldate) |
|||
$if($eq(%label%,8bitpeoples), |
$if($eq(%label%,8bitpeoples), |
||
$set( |
$set(_labelandcatno,yes) |
||
$set(_label,%label%) |
|||
$set(_catno,%catalognumber%) |
|||
$add_to_collection(56cd604b-c02a-4f4a-9b75-400692624831) |
$add_to_collection(56cd604b-c02a-4f4a-9b75-400692624831) |
||
, |
, |
||
) |
) |
||
$if($eq(%label%,OverClocked ReMix), |
$if($eq(%label%,OverClocked ReMix), |
||
$set( |
$set(_labelandcatno,yes) |
||
$set(_label,%label%) |
|||
$set(_catno,%catalognumber%) |
|||
$add_to_collection(450a79e3-73ba-44a0-9d99-64651e7b65ff) |
|||
, |
, |
||
) |
) |
||
$unset(label) |
|||
$keep(artist,album,title,albumartist,date,discsubtitle,,tracknumber,totaltracks,discnumber,totaldiscs,releasetype,composer) |
|||
</pre> |
</pre> |
||
=== Picard file naming === |
=== Picard file naming === |
||
This needs the [https://github.com/mineo/mbstuff/tree/master/picard/plugins/iprefersnakes I Prefer Snakes] plugin. |
|||
<pre> |
<pre> |
||
m = metadata |
|||
$if($in(%_dirname%,_misc), |
|||
misc/tagged/%artist% - %title% |
|||
$stop() |
|||
,) |
|||
$if($and($inmulti(%releasetype%,soundtrack),$not(%_pathextra%)), |
|||
$noop(begin soundtrack) |
|||
$if( |
|||
$in(%_dirname%, Score), |
|||
Soundtracks - Score, |
|||
Soundtracks |
|||
) |
|||
/%album% - $if(%_releasecomment%,\(%_releasecomment%\) ,)$if2(%albumartist%,%albumartist%) |
|||
$if( |
|||
%date%, |
|||
\($left(%date%,4)\), |
|||
) |
|||
at = u"{artist} - {title}".format(artist=m["artist"], title=m["title"]) |
|||
/ |
|||
$noop(end soundtrack), |
|||
$noop(begin pathextra) |
|||
$if(%_pathextra%, |
|||
%_pathextra%/, |
|||
) |
|||
$noop(end pathextra) |
|||
$noop(begin normal) |
|||
$if2( |
|||
%albumartist%, |
|||
%artist% |
|||
)/ |
|||
$if( |
|||
%date%, |
|||
$left(%date%,4) - , |
|||
) |
|||
%album%/ |
|||
) |
|||
$noop(end normal)/ |
|||
$if( |
|||
$gt(%totaldiscs%, 1), |
|||
Disc %_paddeddiscnumber%/, |
|||
) |
|||
%_paddedtracknumber% - %title% |
|||
</pre> |
|||
if u"OC ReMix" in m["~filename"]: |
|||
=== MusicBrainz basic database setup === |
|||
return u"OverClocked ReMix/misc/" + at |
|||
if m["albumartist"] == "OverClocked ReMix": |
|||
* Follow INSTALL to point 3a) |
|||
m["albumartist"] = "Various Artists" |
|||
* carton exec ./script/setup_test_db_for_selenium.pl |
|||
* start the server with MUSICBRAINZ_USE_TEST_DATABASE=1 carton exec -Ilib -- plackup -r |
|||
* connect directly to the DB with carton exec ./admin/psql |
|||
if u"_misc_" in m["~dirname"]: |
|||
{{lang de-native}} |
|||
return u"misc/tagged/" + at |
|||
{{lang en-fluent}} |
|||
theend = u"{tn} - {title}".format(tn=m["~paddedtracknumber"], title=m["title"]) |
|||
if m["date"]: |
|||
year = m["date"][:4] |
|||
paryear = u" (" + unicode(year) + u")" |
|||
else: |
|||
year = None |
|||
paryear = "" |
|||
try: |
|||
td = int(m["totaldiscs"]) |
|||
if td > 1: |
|||
disc = u"Disc {disc}".format(disc=m["discnumber"]) |
|||
else: |
|||
disc = u"" |
|||
except: |
|||
disc = u"" |
|||
if m["~labelandcatno"]: |
|||
return u"{label}/{catno}{album}{year}/{disc}/{theend}".format( |
|||
label=m["~label"], |
|||
catno=m["~catno"] + u" - " if m["~catno"] else u"", |
|||
album=m["album"], |
|||
year=paryear, |
|||
theend=theend, |
|||
disc=disc |
|||
) |
|||
split_path = m["~dirname"].split(u"_") |
|||
for p in split_path: |
|||
if p.startswith(u"Soundtracks"): |
|||
soundtrackprefix = p |
|||
break |
|||
else: |
|||
soundtrackprefix = None |
|||
if soundtrackprefix is not None: |
|||
return u"{prefix}/{album}{comment} - {albumartist}{year}/{disc}/{theend}".format( |
|||
prefix=soundtrackprefix, |
|||
album=m["album"], |
|||
comment=(u"(" + m["~releasecomment"] + u")") if m["~releasecomment"] else u"", |
|||
albumartist=m["albumartist"], |
|||
year=paryear, |
|||
theend=theend, |
|||
disc=disc |
|||
) |
|||
return u"{albumartist}/{year}{album}/{disc}/{theend}".format( |
|||
albumartist=m["albumartist"] if m["albumartist"] else m["artist"], |
|||
year=(year + u" - ") if year is not None else u"", |
|||
album=m["album"], |
|||
theend=theend, |
|||
disc=disc) |
|||
</pre> |
Latest revision as of 13:32, 28 March 2016
Websites with catalogues of classical music
aria2c download list for MB dumps
ftp://mirrors.dotsrc.org/MusicBrainz/data/fullexport/LATEST/mbdump.tar.bz2 ftp://ftp.musicbrainz.org/pub/musicbrainz/data/fullexport/LATEST/mbdump.tar.bz2 ftp://mirrors.dotsrc.org/MusicBrainz/data/fullexport/LATEST/mbdump-editor.tar.bz2 ftp://mirrors.dotsrc.org/MusicBrainz/data/fullexport/LATEST/mbdump-editor.tar.bz2 ftp://ftp.musicbrainz.org/pub/musicbrainz/data/fullexport/LATEST/mbdump-derived.tar.bz2 ftp://ftp.musicbrainz.org/pub/musicbrainz/data/fullexport/LATEST/mbdump-derived.tar.bz2
Those are tabs (\t) separating the URLs, not spaces! Replace latest with the real folder name. Then save all the URLs to a file and run aria2c like so:
aria2c -j 6 -i <filename>
to download the files to the current directory
ListenBrainz
submit via curl
curl -X POST -d @foo.json -H "Authorization: Token aebacb47-a7a2-4b71-ac77-424883c920dc" http://10.1.2.3:8080/1/submit-listens
transform a JSON document from the GET listens API for import
jq "{listen_type: \"import\", payload: [.payload.listens[]|del(.recording_msid)]}" < foo.json > foo2.json
Picard
For the following to work, you'll need all plugins except cue.py from my plugin repository.
Picard scripting
$if($eq(%label%,8bitpeoples), $set(_labelandcatno,yes) $set(_label,%label%) $set(_catno,%catalognumber%) $add_to_collection(56cd604b-c02a-4f4a-9b75-400692624831) , ) $if($eq(%label%,OverClocked ReMix), $set(_labelandcatno,yes) $set(_label,%label%) $set(_catno,%catalognumber%) $add_to_collection(450a79e3-73ba-44a0-9d99-64651e7b65ff) , ) $keep(artist,album,title,albumartist,date,discsubtitle,,tracknumber,totaltracks,discnumber,totaldiscs,releasetype,composer)
Picard file naming
This needs the I Prefer Snakes plugin.
m = metadata at = u"{artist} - {title}".format(artist=m["artist"], title=m["title"]) if u"OC ReMix" in m["~filename"]: return u"OverClocked ReMix/misc/" + at if m["albumartist"] == "OverClocked ReMix": m["albumartist"] = "Various Artists" if u"_misc_" in m["~dirname"]: return u"misc/tagged/" + at theend = u"{tn} - {title}".format(tn=m["~paddedtracknumber"], title=m["title"]) if m["date"]: year = m["date"][:4] paryear = u" (" + unicode(year) + u")" else: year = None paryear = "" try: td = int(m["totaldiscs"]) if td > 1: disc = u"Disc {disc}".format(disc=m["discnumber"]) else: disc = u"" except: disc = u"" if m["~labelandcatno"]: return u"{label}/{catno}{album}{year}/{disc}/{theend}".format( label=m["~label"], catno=m["~catno"] + u" - " if m["~catno"] else u"", album=m["album"], year=paryear, theend=theend, disc=disc ) split_path = m["~dirname"].split(u"_") for p in split_path: if p.startswith(u"Soundtracks"): soundtrackprefix = p break else: soundtrackprefix = None if soundtrackprefix is not None: return u"{prefix}/{album}{comment} - {albumartist}{year}/{disc}/{theend}".format( prefix=soundtrackprefix, album=m["album"], comment=(u"(" + m["~releasecomment"] + u")") if m["~releasecomment"] else u"", albumartist=m["albumartist"], year=paryear, theend=theend, disc=disc ) return u"{albumartist}/{year}{album}/{disc}/{theend}".format( albumartist=m["albumartist"] if m["albumartist"] else m["artist"], year=(year + u" - ") if year is not None else u"", album=m["album"], theend=theend, disc=disc)