mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
changed maxdisc and maxtrack to disctotal and tracktotal (clearer)
--HG-- extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4064
This commit is contained in:
parent
4a092d8809
commit
e836a76d0d
4 changed files with 78 additions and 78 deletions
|
|
@ -6,21 +6,21 @@ from string import Template
|
|||
# library. These are used directly in SQL; they are vulnerable to injection if
|
||||
# accessible to the user.
|
||||
metadata_fields = [
|
||||
('title', 'text'),
|
||||
('artist', 'text'),
|
||||
('album', 'text'),
|
||||
('genre', 'text'),
|
||||
('composer', 'text'),
|
||||
('grouping', 'text'),
|
||||
('year', 'int'),
|
||||
('track', 'int'),
|
||||
('maxtrack', 'int'),
|
||||
('disc', 'int'),
|
||||
('maxdisc', 'int'),
|
||||
('lyrics', 'text'),
|
||||
('comments', 'text'),
|
||||
('bpm', 'int'),
|
||||
('comp', 'bool'),
|
||||
('title', 'text'),
|
||||
('artist', 'text'),
|
||||
('album', 'text'),
|
||||
('genre', 'text'),
|
||||
('composer', 'text'),
|
||||
('grouping', 'text'),
|
||||
('year', 'int'),
|
||||
('track', 'int'),
|
||||
('tracktotal', 'int'),
|
||||
('disc', 'int'),
|
||||
('disctotal', 'int'),
|
||||
('lyrics', 'text'),
|
||||
('comments', 'text'),
|
||||
('bpm', 'int'),
|
||||
('comp', 'bool'),
|
||||
]
|
||||
item_fields = [
|
||||
('id', 'integer primary key'),
|
||||
|
|
@ -251,7 +251,7 @@ class Item(object):
|
|||
if isinstance(value, str) or isinstance(value, unicode):
|
||||
value.replace(os.sep, '_')
|
||||
re.sub(r'[' + os.sep + r']|^\.', '_', value)
|
||||
elif key in ('track', 'maxtrack', 'disc', 'maxdisc'):
|
||||
elif key in ('track', 'tracktotal', 'disc', 'disctotal'):
|
||||
# pad with zeros
|
||||
value = '%02i' % value
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ class MediaFile(object):
|
|||
id3_style = STORE_LIST | STORE_SLASHED | STORE_LEFT,
|
||||
mp4_style = STORE_LIST | STORE_2PLE | STORE_LEFT,
|
||||
out_type = int)
|
||||
maxtrack = MediaField('TRCK', 'trkn', 'tracktotal',
|
||||
tracktotal = MediaField('TRCK', 'trkn', 'tracktotal',
|
||||
id3_style = STORE_LIST | STORE_SLASHED | STORE_RIGHT,
|
||||
mp4_style = STORE_LIST | STORE_2PLE | STORE_RIGHT,
|
||||
out_type = int)
|
||||
|
|
@ -344,7 +344,7 @@ class MediaFile(object):
|
|||
id3_style = STORE_LIST | STORE_SLASHED | STORE_LEFT,
|
||||
mp4_style = STORE_LIST | STORE_2PLE | STORE_LEFT,
|
||||
out_type = int)
|
||||
maxdisc = MediaField('TPOS', 'disk', 'disctotal',
|
||||
disctotal = MediaField('TPOS', 'disk', 'disctotal',
|
||||
id3_style = STORE_LIST | STORE_SLASHED | STORE_RIGHT,
|
||||
mp4_style = STORE_LIST | STORE_2PLE | STORE_RIGHT,
|
||||
out_type = int)
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -65,76 +65,76 @@ def MakeWritingTest(path, correct_dict, field, testsuffix='_test'):
|
|||
correct_dicts = {
|
||||
|
||||
'full': {
|
||||
'title': u'full',
|
||||
'artist': u'the artist',
|
||||
'album': u'the album',
|
||||
'genre': u'the genre',
|
||||
'composer': u'the composer',
|
||||
'grouping': u'the grouping',
|
||||
'year': 2001,
|
||||
'track': 2,
|
||||
'maxtrack': 3,
|
||||
'disc': 4,
|
||||
'maxdisc': 5,
|
||||
'lyrics': u'the lyrics',
|
||||
'comments': u'the comments',
|
||||
'bpm': 6,
|
||||
'comp': True
|
||||
'title': u'full',
|
||||
'artist': u'the artist',
|
||||
'album': u'the album',
|
||||
'genre': u'the genre',
|
||||
'composer': u'the composer',
|
||||
'grouping': u'the grouping',
|
||||
'year': 2001,
|
||||
'track': 2,
|
||||
'tracktotal': 3,
|
||||
'disc': 4,
|
||||
'disctotal': 5,
|
||||
'lyrics': u'the lyrics',
|
||||
'comments': u'the comments',
|
||||
'bpm': 6,
|
||||
'comp': True
|
||||
},
|
||||
|
||||
'partial': {
|
||||
'title': u'partial',
|
||||
'artist': u'the artist',
|
||||
'album': u'the album',
|
||||
'genre': u'',
|
||||
'composer': u'',
|
||||
'grouping': u'',
|
||||
'year': 0,
|
||||
'track': 2,
|
||||
'maxtrack': 0,
|
||||
'disc': 4,
|
||||
'maxdisc': 0,
|
||||
'lyrics': u'',
|
||||
'comments': u'',
|
||||
'bpm': 0,
|
||||
'comp': False
|
||||
'title': u'partial',
|
||||
'artist': u'the artist',
|
||||
'album': u'the album',
|
||||
'genre': u'',
|
||||
'composer': u'',
|
||||
'grouping': u'',
|
||||
'year': 0,
|
||||
'track': 2,
|
||||
'tracktotal': 0,
|
||||
'disc': 4,
|
||||
'disctotal': 0,
|
||||
'lyrics': u'',
|
||||
'comments': u'',
|
||||
'bpm': 0,
|
||||
'comp': False
|
||||
},
|
||||
|
||||
'min': {
|
||||
'title': u'min',
|
||||
'artist': u'',
|
||||
'album': u'',
|
||||
'genre': u'',
|
||||
'composer': u'',
|
||||
'grouping': u'',
|
||||
'year': 0,
|
||||
'track': 0,
|
||||
'maxtrack': 0,
|
||||
'disc': 0,
|
||||
'maxdisc': 0,
|
||||
'lyrics': u'',
|
||||
'comments': u'',
|
||||
'bpm': 0,
|
||||
'comp': False
|
||||
'title': u'min',
|
||||
'artist': u'',
|
||||
'album': u'',
|
||||
'genre': u'',
|
||||
'composer': u'',
|
||||
'grouping': u'',
|
||||
'year': 0,
|
||||
'track': 0,
|
||||
'tracktotal': 0,
|
||||
'disc': 0,
|
||||
'disctotal': 0,
|
||||
'lyrics': u'',
|
||||
'comments': u'',
|
||||
'bpm': 0,
|
||||
'comp': False
|
||||
},
|
||||
|
||||
# empty.mp3 has had its ID3 tag deleted with mp3info -d
|
||||
'empty': {
|
||||
'title': u'',
|
||||
'artist': u'',
|
||||
'album': u'',
|
||||
'genre': u'',
|
||||
'composer': u'',
|
||||
'grouping': u'',
|
||||
'year': 0,
|
||||
'track': 0,
|
||||
'maxtrack': 0,
|
||||
'disc': 0,
|
||||
'maxdisc': 0,
|
||||
'lyrics': u'',
|
||||
'comments': u'',
|
||||
'bpm': 0,
|
||||
'comp': False
|
||||
'title': u'',
|
||||
'artist': u'',
|
||||
'album': u'',
|
||||
'genre': u'',
|
||||
'composer': u'',
|
||||
'grouping': u'',
|
||||
'year': 0,
|
||||
'track': 0,
|
||||
'tracktotal': 0,
|
||||
'disc': 0,
|
||||
'disctotal': 0,
|
||||
'lyrics': u'',
|
||||
'comments': u'',
|
||||
'bpm': 0,
|
||||
'comp': False
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue