Added Starred for Album and MediaFile

This commit is contained in:
Deluan 2016-03-03 01:07:13 -05:00
parent 393b7f5b90
commit f01a5f143d
7 changed files with 11 additions and 3 deletions

View File

@ -3,7 +3,7 @@ path = github.com/deluan/gosonic
[deps]
github.com/astaxie/beego = commit:92d0b9a
github.com/dhowden/itl = commit:35d15a3
github.com/deluan/itl = commit:35d15a3
github.com/siddontang/ledisdb = commit:713b229
github.com/smartystreets/goconvey = commit:899ed5a
github.com/karlkfi/inject = commit:fe06da2

View File

@ -9,7 +9,7 @@ install:
- go get github.com/gpmgo/gopm
- gopm list -v
- go get github.com/astaxie/beego
- go get github.com/dhowden/itl
- go get github.com/deluan/itl
- go get github.com/siddontang/ledisdb/ledis
- go get github.com/karlkfi/inject
- go get github.com/smartystreets/goconvey

View File

@ -9,6 +9,7 @@ type Album struct {
AlbumArtist string
Year int
Compilation bool
Starred bool
Rating int
Genre string
}

View File

@ -21,6 +21,7 @@ type MediaFile struct {
BitRate int
Genre string
Compilation bool
Starred bool
CreatedAt time.Time
UpdatedAt time.Time
}

View File

@ -1,7 +1,7 @@
package scanner
import (
"github.com/dhowden/itl"
"github.com/deluan/itl"
"net/url"
"os"
"path/filepath"
@ -26,6 +26,8 @@ func (s *ItunesScanner) LoadFolder(path string) []Track {
mediaFiles[i].AlbumArtist = unescape(t.AlbumArtist)
mediaFiles[i].Genre = unescape(t.Genre)
mediaFiles[i].Compilation = t.Compilation
mediaFiles[i].Loved = t.Loved
mediaFiles[i].AlbumLoved = t.AlbumLoved
mediaFiles[i].Year = t.Year
mediaFiles[i].TrackNumber = t.TrackNumber
mediaFiles[i].DiscNumber = t.DiscNumber

View File

@ -71,6 +71,7 @@ func parseTrack(t *Track) (*domain.MediaFile, *domain.Album, *domain.Artist) {
AlbumArtist: t.AlbumArtist,
Title: t.Title,
Compilation: t.Compilation,
Starred: t.Loved,
Path: t.Path,
CreatedAt: t.CreatedAt,
UpdatedAt: t.UpdatedAt,
@ -88,6 +89,7 @@ func parseTrack(t *Track) (*domain.MediaFile, *domain.Album, *domain.Artist) {
Name: t.Album,
Year: t.Year,
Compilation: t.Compilation,
Starred: t.Loved,
Genre: t.Genre,
Artist: t.Artist,
AlbumArtist: t.AlbumArtist,

View File

@ -20,6 +20,8 @@ type Track struct {
Duration int
BitRate int
Compilation bool
Loved bool
AlbumLoved bool
CreatedAt time.Time
UpdatedAt time.Time
}