Ejemplo n.º 1
0
def get_artist_path(artist_name, fn=None):
    cfg = cdam.Settings()
    result = os.path.join(cfg.path_music_path(),
                          cu.change_characters(cu.smart_unicode(artist_name)))
    if fn:
        result = os.path.join(result, fn)
    return sanitize(result)
Ejemplo n.º 2
0
def cdart_get_backup_filename(artist, album, disc_num=1):
    cfg = cdam.Settings()
    fn_format = cfg.folder()
    backup_folder = cfg.path_backup_path()
    if not backup_folder:
        cfg.open()
        backup_folder = cfg.path_backup_path()
    if fn_format == 0:
        destination = os.path.join(backup_folder, cu.change_characters(artist))
        fn = os.path.join(destination, cu.change_characters(album))
    else:
        destination = backup_folder
        fn = os.path.join(
            destination, cu.change_characters(
                (artist + " - " + album).lower()))
    if disc_num > 1:
        fn += "_disc_" + str(disc_num)
    fn += ".png"
    log("backup filename: %s" % fn, xbmc.LOGDEBUG)
    return fn
Ejemplo n.º 3
0
# -*- coding: utf-8 -*-

import re
from traceback import print_exc
from urllib import quote_plus

import xbmc
import cdam
import cdam_utils as cu
import cdam_db

from cdam_utils import log

__cdam__ = cdam.CDAM()
__cfg__ = cdam.Settings()

artist_url = '%s/ws/2/artist/?query=artist:"%s"&limit=%d'
alias_url = '%s/ws/2/artist/?query=alias:"%s"&limit=%d'
release_group_url = '%s/ws/2/release-group/'
release_group_url_artist = release_group_url + '?query="%s"%s AND artist:"%s"'
release_group_url_alias = release_group_url + '?query="%s"%s AND alias:"%s"'
nolive_nosingles = ' NOT type:single NOT type:live'
live_nosingles = ' NOT type:single'
query_limit = '&limit=%d'

release_group_url_using_release_name = '%s/ws/2/release-group/?query=release:"%s"%s AND artist:"%s"&limit=%d'
release_group_url_using_release_name_alias = '%s/ws/2/release-group/?query=release:"%s"%s AND alias:"%s"&limit=%d'
release_group_url_release_mbid = '%s/ws/2/release-group/?release=%s'
release_groups_url_artist_mbid = '%s/ws/2/release-group/?artist="%s"'
artist_id_check = '%s/ws/2/artist/%s'
release_group_id_check = '%s/ws/2/release-group/%s'