CC-5050: Tracks with a very high track count cannot be saved into database

-fixed
This commit is contained in:
Martin Konecny 2013-04-22 17:54:25 -04:00
parent 07f0ae6c28
commit 80bd57ce4e
3 changed files with 21 additions and 2 deletions

View file

@ -465,6 +465,14 @@ def truncate_to_length(item, length):
if len(item) > length: return item[0:length]
else: return item
def truncate_to_value(item, value):
""" Truncates 'item' to 'value' """
if isinstance(item, basestring): item = int(item)
if isinstance(item, int):
item = abs(item)
if item > value: item = value
return str(item)
def format_length(mutagen_length):
""" Convert mutagen length to airtime length """
t = float(mutagen_length)