Skip to content

Commit

Permalink
Add mp3 set genre
Browse files Browse the repository at this point in the history
  • Loading branch information
sirfoga committed Sep 22, 2017
1 parent 221fe01 commit 06e7cf9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.

### 4.6.4 - 2017-09-22

### Added
- mp3 set genre

### 4.6.3 - 2017-08-23

Expand Down
13 changes: 12 additions & 1 deletion hal/files/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import re

from mutagen.id3 import ID3
from mutagen.id3._frames import TIT2, TPE1, TALB, TRCK, TDRC
from mutagen.id3._frames import TIT2, TPE1, TALB, TRCK, TDRC, TCON
from mutagen.mp3 import MP3
from send2trash import send2trash

Expand Down Expand Up @@ -554,3 +554,14 @@ def set_year(self, year):

self.tags.add(TDRC(encoding=3, text=str(year)))
self.song.save()

def set_genre(self, genre):
"""
:param genre: str
Genre of song
:return: void
Sets song's genre
"""

self.tags.add(TCON(encoding=3, text=str(genre)))
self.song.save()

0 comments on commit 06e7cf9

Please sign in to comment.