Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
PLUGIN_NAME = u"Add Track As Recording"
PLUGIN_AUTHOR = u"Freso, Lukáš Lalinský, Philip Jägenstedt"
PLUGIN_DESCRIPTION = ""
PLUGIN_VERSION = "0.1"
PLUGIN_API_VERSIONS = ["1.0.0"]
from picard import log
#from picard.metadata import register_file_metadata_processor
@Freso
Freso / mopidy.service
Created November 12, 2013 16:59
Place in `~/.config/systemd/user` and enable it using `systemctl --user enable mopidy`.
[Unit]
Description=mopidy
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/mopidy
[Install]
WantedBy=default.target
#!/bin/dash
BACKUPDIR="$HOME/aticonfig-backup-`date --rfc-3339=sec --utc`"
XORGFILE='/etc/X11/xorg.conf.d/20-aticonfig.conf'
mkdir "$BACKUPDIR"
cd "$BACKUPDIR"
mv -vi /etc/ati/amdpcsdb "$BACKUPDIR"
mv -vi "$XORGFILE" "$BACKUPDIR"
<tr class="addnew">
<td class="select">
<input class="newrecording recordingmatch" name="select-recording-0-3" id="select-recording-0-3-addnew" type="radio">
</td>
<td class="recording" colspan="3"><label for="select-recording-0-3-addnew">Add a new recording</label></td>
</tr>
otherdatabases: {
match: new RegExp("^(https?://)?(www\\.)?(rateyourmusic\\.com/|worldcat\\.org/|musicmoz\\.org/|45cat\\.com/|musik-sammler\\.de/|discografia\\.dds\\.it/|tallinn\\.ester\\.ee/|tartu\\.ester\\.ee/|encyclopedisque\\.fr/|discosdobrasil\\.com\\.br/|isrc\\.ncl\\.edu\\.tw/|rolldabeats\\.com/|psydb\\.net/|metal-archives\\.com/|spirit-of-metal\\.com/|ibdb\\.com/|lortel.\\org/|theatricalia\\.com/|ocremix\\.org/|trove\\.nla\\.gov\\.au/|(wiki\\.)?rockinchina\\.com|(www\\.)?dhhu\\.dk|thesession\\.org)", "i"),
type: MB.constants.LINK_TYPES.otherdatabases,
clean: function(url) {
//Removing cruft from Worldcat URLs
url = url.replace(/^(?:https?:\/\/)?(?:www\.)?worldcat\.org(?:\/title\/[a-zA-Z0-9_-]+)?\/oclc\/([^&?]+)(?:.*)$/, "http://www.worldcat.org/oclc/$1");
//Standardising IBDb not to use www
url = url.replace(/^(https?:\/\/)?(www\.)?ibdb\.com/, "http://ibdb.com");
//Standardising ESTER to their default parameters
@Freso
Freso / Pocoo Styleguide question.py
Last active December 10, 2015 13:59
Which of these are correct?
def spam(argument2):
this_is_a_very_long([
'this is the first', 'set of items', 'with more items',
'to come in this line', 'like this'
], argument2)
def eggs(argument2):
this_is_a_very_long([
'this is the first', 'set of items', 'with more items',
'to come in this line', 'like this'
@Freso
Freso / gist:4428921
Last active December 10, 2015 11:38

Hello all,

I've been missing a "language" attribute for URLs for a while, as I'm frequently adding e.g. Danish reviews of release groups. This post is to discuss the feature and try to convince all the rest of you that it'd be nifty to have as well. Please chime in with questions and comments and suggestions!

Uses

Some use cases I see for this could be, once we actually launch a localised musicbrainz.org, to only show URLs based on locale (e.g., show English language links for English language locales).

This would also be something I'd want for MusicBottle - to only display links relevant for the language the person is browsing in (probably like "eng+mul+$sessionlanguage"). If a user is browsing in Danish, it's unlikely they want to read a review in Greek.

@Freso
Freso / gist:4427854
Last active December 10, 2015 11:29
<td>
[%- IF medium_edit.title && medium_edit.old == 'new' -%]
[%- l('Disc <span class="new">{new}</span>: {title} (new disc)',
new => medium_edit.new, title => medium_edit.title) -%]
[%- ELSIF medium_edit.title -%]
[%- l('Disc <span class="new">{new}</span>: {title} (moved from position <span class="old">{old}</span>)',
new => medium_edit.new, title => medium_edit.title, , old => medium_edit.old) -%]
[%- ELSIF medium_edit.old == 'new' -%]
[%- l('Disc <span class="new">{new}</span> (new disc)',
new => medium_edit.new) -%]
#!/usr/bin/python2
# -*- coding: utf-8 -*-
"""Test coverage for MusicBottle."""
import musicbottle
from flask.ext.testing import TestCase
class MusicBottleTestCase(TestCase):
def create_app(self):
musicbottle.app.config['TESTING'] = True
{'attribs': {u'id': u'2c6c5a89-12c8-45ac-acc6-7c3dd46e3fdd'},
'children': {u'artist_credit': [{'attribs': {},
'children': {u'name_credit': [{'attribs': {},
'children': {u'artist': [{'attribs': {u'id': u'9bffb20c-dd17-4895-9fd1-4e73e888d799'},
'children': {u'name': [{'attribs': {},
'children': {},
'text': u'\u30e2\u30fc\u30cb\u30f3\u30b0\u5a18\u3002'}],
u'sort_name': [{'attribs': {},