From e836a76d0d5e19fef735f66c2998905d72bdaca0 Mon Sep 17 00:00:00 2001 From: "adrian.sampson" Date: Sun, 6 Jul 2008 20:26:49 +0000 Subject: [PATCH] changed maxdisc and maxtrack to disctotal and tracktotal (clearer) --HG-- extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4064 --- beets/library.py | 32 +++++------ beets/mediafile.py | 4 +- test/rsrc/get.blb | Bin 4096 -> 4096 bytes test/test_mediafile.py | 120 ++++++++++++++++++++--------------------- 4 files changed, 78 insertions(+), 78 deletions(-) diff --git a/beets/library.py b/beets/library.py index bc12ee2bd..6441f6f24 100644 --- a/beets/library.py +++ b/beets/library.py @@ -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: diff --git a/beets/mediafile.py b/beets/mediafile.py index fc5fca7c0..269871254 100644 --- a/beets/mediafile.py +++ b/beets/mediafile.py @@ -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) diff --git a/test/rsrc/get.blb b/test/rsrc/get.blb index fe621332bedbb435c0c5c3b5496529b756e467b9..de819dd57a3a940b24e91517420cd9e0593046ee 100644 GIT binary patch delta 81 zcmZorXi%6S&B!=W#*f2`fjOM{ER)w}L6#egTuofe?Be3$jLpT9BbZhzmlP!?XP4xc ZB<3h&=9TCuq+}K+BUoUG%}UJocmR)47`y-g delta 77 zcmZorXi%6S&B!)U#*f2~fjOM{ER)}6L6$p=Tup4u?Be3$jLq4TLzq^}=O$K^6eT8S ZD`e)C=qRLQ7AHekKyeUfvl8