forked from philipmat/discogs-xml2db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.py
123 lines (107 loc) · 2.69 KB
/
model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class Artist:
def __init__(self):
self.id = 0
self.name = ''
self.realname = ''
self.images = []
#self.urls = {'wikipedia':None, 'myspace':None,'other':[]}
self.urls = []
self.namevariations = []
self.aliases = []
self.profile = ''
self.members = []#MemberNameList, foreign key name, class Artist
self.groups = []#GroupNameList, foreign key name, class Artist
#self.artistType = 0 #0 = person, 1 = group
#self.artist_id = ''
class Release:
def __init__(self):
self.id = 0
self.status = ''
self.title = ''
self.country = ''
self.released = ''
self.notes = ''
self.genres = []
self.styles = []
self.images = []
self.formats = []
self.labels = []
self.anv = '' #used only if artist name is missing
self.artist = ''
self.artists = [] #join
self.artistJoins = [] #release_artist_artist
self.tracklist = [] #join
self.extraartists = []
#self.indentifiers = [] #
class Master:
def __init__(self):
self.id = 0
#self.status = ''
self.title = ''
self.main_release = 0
self.year = 0
self.notes = ''
self.genres = []
self.styles = []
self.images = []
self.anv = '' #used only if artist name is missing
self.artist = ''
self.artists = [] #join
self.artistJoins = [] #release_artist_artist
self.extraartists = []
class ArtistJoin:
def __init__(self):
self.artist1 = ''
self.join_relation = ''
class Extraartist:
def __init__(self):
self.name = ''
self.roles = []
class ReleaseLabel:
def __init__(self):
self.name = ''
self.catno = ''
class Label:
def __init__(self):
self.id = 0
self.name = ''
self.images = []
self.contactinfo = ''
self.profile = ''
self.parentLabel = ''
self.urls = []
self.sublabels = []
class Format:
def __init__(self):
self.name = ''
self.qty = 0
self.descriptions = []
class Style:
def __init__(self, name):
self.name = name
#self.genres = []
class Genre:
def __init__(self, name):
self.name = name
class Track:
def __init__(self):
self.artists = []
self.artistJoins = []
self.extraartists = []
self.title = ''
self.duration = ''
self.position = ''
class ImageInfo:
def __init__(self):
self.height = 0
self.imageType = None #enum ImageType.PRIMARY or ImageType.SECONDARY
self.uri = ''
self.uri150 = ''
self.width = 0
class ImageType:
PRIMARY = 0
SECONDARY = 1
class ParserStopError(Exception):
"""Raised by a parser to signal that it wants to stop parsing."""
def __init__(self, count):
self.records_parsed = count