Skip to content

Commit

Permalink
Convert audio length to an int
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrgn committed Mar 31, 2013
1 parent 1cdc6a1 commit 20a2171
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions shiva/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class Track(db.Model):
slug = db.Column(db.String(128), unique=True)
bitrate = db.Column(db.Integer)
file_size = db.Column(db.Integer)
# TODO could be float if number weren't converted to an int in metadata manager
length = db.Column(db.Integer)
# TODO number should probably be renamed to track or track_number
number = db.Column(db.Integer)
Expand Down
2 changes: 1 addition & 1 deletion shiva/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def genre(self, value):
@property
def length(self):
"""The length of the song in seconds."""
return self.reader.info.length
return int(round(self.reader.info.length))

@property
def bitrate(self):
Expand Down

0 comments on commit 20a2171

Please sign in to comment.