Merge branch 'master' of github.com:sentriz/gonic into features/transcoding

This commit is contained in:
Serge Tkatchouk
2020-03-04 13:01:34 +08:00
30 changed files with 181 additions and 174 deletions

View File

@@ -67,6 +67,7 @@ type Track struct {
TagTrackArtist string `sql:"default: null"`
TagTrackNumber int `sql:"default: null"`
TagDiscNumber int `sql:"default: null"`
TagBrainzID string `sql:"default: null"`
}
func (t *Track) Ext() string {

View File

@@ -336,6 +336,7 @@ func (s *Scanner) handleTrack(it *item) error {
track.TagTrackArtist = trTags.Artist()
track.TagTrackNumber = trTags.TrackNumber()
track.TagDiscNumber = trTags.DiscNumber()
track.TagBrainzID = trTags.BrainzID()
track.Length = trTags.Length() // these two should be calculated
track.Bitrate = trTags.Bitrate() // ...from the file instead of tags
//

View File

@@ -34,6 +34,7 @@ func (t *Tags) firstTag(keys ...string) string {
}
func (t *Tags) Title() string { return t.firstTag("title") }
func (t *Tags) BrainzID() string { return t.firstTag("musicbrainz_trackid") }
func (t *Tags) Artist() string { return t.firstTag("artist") }
func (t *Tags) Album() string { return t.firstTag("album") }
func (t *Tags) AlbumArtist() string { return t.firstTag("albumartist", "album artist") }

View File

@@ -134,7 +134,8 @@ type TrackChild struct {
}
type Artists struct {
List []*Index `xml:"index" json:"index"`
IgnoredArticles string `xml:"ignoredArticles,attr" json:"ignoredArticles"`
List []*Index `xml:"index" json:"index"`
}
type Artist struct {
@@ -146,8 +147,9 @@ type Artist struct {
}
type Indexes struct {
LastModified int `xml:"lastModified,attr,omitempty" json:"lastModified"`
Index []*Index `xml:"index" json:"index"`
LastModified int `xml:"lastModified,attr,omitempty" json:"lastModified"`
IgnoredArticles string `xml:"ignoredArticles,attr" json:"ignoredArticles"`
Index []*Index `xml:"index" json:"index"`
}
type Index struct {

Binary file not shown.

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"albumList": {
"album": [
{

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"albumList": {
"album": [
{

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"albumList": {
"album": [
{

View File

@@ -3,9 +3,85 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"albumList": {
"album": [
{
"id": "17",
"coverArt": "17",
"artist": "Swell Maps",
"title": "(1979) A Trip to Marineville",
"parent": "15",
"isDir": true,
"songCount": 18,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "9",
"coverArt": "9",
"artist": "13th Floor Lowervators",
"title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators",
"parent": "7",
"isDir": true,
"songCount": 21,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "19",
"coverArt": "19",
"artist": "Ten Years After",
"title": "(1967) Ten Years After",
"parent": "18",
"isDir": true,
"songCount": 15,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "13",
"coverArt": "13",
"artist": "There",
"title": "(2010) Anika",
"parent": "12",
"isDir": true,
"songCount": 9,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "21",
"coverArt": "21",
"artist": "Captain Beefheart",
"title": "(1970) Lick My Decals Off, Bitch",
"parent": "20",
"isDir": true,
"songCount": 15,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "6",
"artist": "A Certain Ratio",
"title": "(1981) To EachOTHER.",
"parent": "4",
"isDir": true,
"songCount": 9,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "3",
"coverArt": "3",
"artist": "Jah Wobble, The Edge, Holger Czukay",
"title": "(1983) Snake Charmer",
"parent": "2",
"isDir": true,
"songCount": 5,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "16",
"coverArt": "16",
@@ -28,50 +104,6 @@
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "17",
"coverArt": "17",
"artist": "Swell Maps",
"title": "(1979) A Trip to Marineville",
"parent": "15",
"isDir": true,
"songCount": 18,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "19",
"coverArt": "19",
"artist": "Ten Years After",
"title": "(1967) Ten Years After",
"parent": "18",
"isDir": true,
"songCount": 15,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "9",
"coverArt": "9",
"artist": "13th Floor Lowervators",
"title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators",
"parent": "7",
"isDir": true,
"songCount": 21,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "13",
"coverArt": "13",
"artist": "There",
"title": "(2010) Anika",
"parent": "12",
"isDir": true,
"songCount": 9,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "5",
"coverArt": "5",
@@ -82,38 +114,6 @@
"songCount": 14,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "6",
"artist": "A Certain Ratio",
"title": "(1981) To EachOTHER.",
"parent": "4",
"isDir": true,
"songCount": 9,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "21",
"coverArt": "21",
"artist": "Captain Beefheart",
"title": "(1970) Lick My Decals Off, Bitch",
"parent": "20",
"isDir": true,
"songCount": 15,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
},
{
"id": "3",
"coverArt": "3",
"artist": "Jah Wobble, The Edge, Holger Czukay",
"title": "(1983) Snake Charmer",
"parent": "2",
"isDir": true,
"songCount": 5,
"duration": 0,
"created": "0001-01-01T00:00:00Z"
}
]
}

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"albumList2": {
"album": [
{

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"albumList2": {
"album": [
{

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"albumList2": {
"album": [
{

View File

@@ -3,49 +3,9 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"albumList2": {
"album": [
{
"id": "19",
"coverArt": "19",
"artistId": "6",
"artist": "Ten Years After",
"name": "Ten Years After",
"songCount": 15,
"duration": 0,
"created": "2019-04-30T16:48:30+01:00"
},
{
"id": "3",
"coverArt": "3",
"artistId": "1",
"artist": "Jah Wobble, The Edge & Holger Czukay",
"name": "Snake Charmer",
"songCount": 5,
"duration": 0,
"created": "2019-05-16T22:10:52+01:00"
},
{
"id": "13",
"coverArt": "13",
"artistId": "4",
"artist": "Anikas",
"name": "Anika",
"songCount": 9,
"duration": 0,
"created": "2019-05-23T15:12:02.921473302+01:00"
},
{
"id": "5",
"coverArt": "5",
"artistId": "2",
"artist": "A Certain Ratio",
"name": "The Graveyard and the Ballroom",
"songCount": 14,
"duration": 0,
"created": "2019-06-05T17:46:37.675917974+01:00"
},
{
"id": "21",
"coverArt": "21",
@@ -56,26 +16,6 @@
"duration": 0,
"created": "2019-06-10T19:26:30.944742894+01:00"
},
{
"id": "16",
"coverArt": "16",
"artistId": "5",
"artist": "Swell Maps",
"name": "Jane From Occupied Europe",
"songCount": 16,
"duration": 0,
"created": "2019-04-30T16:48:48+01:00"
},
{
"id": "8",
"coverArt": "8",
"artistId": "3",
"artist": "13th Floor Elevators",
"name": "Easter Everywhere",
"songCount": 10,
"duration": 0,
"created": "2019-06-13T12:57:28.850090338+01:00"
},
{
"id": "17",
"coverArt": "17",
@@ -86,15 +26,6 @@
"duration": 0,
"created": "2019-04-30T16:48:48+01:00"
},
{
"id": "6",
"artistId": "2",
"artist": "A Certain Ratio",
"name": "To Each...",
"songCount": 9,
"duration": 0,
"created": "2019-05-23T15:12:02.921473302+01:00"
},
{
"id": "9",
"coverArt": "9",
@@ -104,6 +35,75 @@
"songCount": 21,
"duration": 0,
"created": "2019-06-13T12:57:24.306717554+01:00"
},
{
"id": "19",
"coverArt": "19",
"artistId": "6",
"artist": "Ten Years After",
"name": "Ten Years After",
"songCount": 15,
"duration": 0,
"created": "2019-04-30T16:48:30+01:00"
},
{
"id": "5",
"coverArt": "5",
"artistId": "2",
"artist": "A Certain Ratio",
"name": "The Graveyard and the Ballroom",
"songCount": 14,
"duration": 0,
"created": "2019-06-05T17:46:37.675917974+01:00"
},
{
"id": "3",
"coverArt": "3",
"artistId": "1",
"artist": "Jah Wobble, The Edge & Holger Czukay",
"name": "Snake Charmer",
"songCount": 5,
"duration": 0,
"created": "2019-05-16T22:10:52+01:00"
},
{
"id": "8",
"coverArt": "8",
"artistId": "3",
"artist": "13th Floor Elevators",
"name": "Easter Everywhere",
"songCount": 10,
"duration": 0,
"created": "2019-06-13T12:57:28.850090338+01:00"
},
{
"id": "13",
"coverArt": "13",
"artistId": "4",
"artist": "Anikas",
"name": "Anika",
"songCount": 9,
"duration": 0,
"created": "2019-05-23T15:12:02.921473302+01:00"
},
{
"id": "16",
"coverArt": "16",
"artistId": "5",
"artist": "Swell Maps",
"name": "Jane From Occupied Europe",
"songCount": 16,
"duration": 0,
"created": "2019-04-30T16:48:48+01:00"
},
{
"id": "6",
"artistId": "2",
"artist": "A Certain Ratio",
"name": "To Each...",
"songCount": 9,
"duration": 0,
"created": "2019-05-23T15:12:02.921473302+01:00"
}
]
}

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"album": {
"id": "3",
"coverArt": "3",

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"album": {
"id": "2",
"songCount": 0,

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"artist": {
"id": "1",
"name": "Jah Wobble, The Edge & Holger Czukay",

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"artist": {
"id": "3",
"name": "13th Floor Elevators",

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"artist": {
"id": "2",
"name": "A Certain Ratio",

View File

@@ -3,8 +3,9 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"artists": {
"ignoredArticles": "",
"index": [
{
"name": "#",

View File

@@ -3,9 +3,10 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"indexes": {
"lastModified": 0,
"ignoredArticles": "",
"index": [
{
"name": "#",

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"directory": {
"id": "3",
"parent": "2",

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"directory": {
"id": "2",
"name": "Jah Wobble, The Edge, Holger Czukay",

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"searchResult3": {
"artist": [
{

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"searchResult3": {
"artist": [
{

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"searchResult3": {
"artist": [
{

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"searchResult2": {
"artist": [
{

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"searchResult2": {
"artist": [
{

View File

@@ -3,7 +3,7 @@
"status": "ok",
"version": "1.9.0",
"type": "gonic",
"gonicVersion": "v0.7.4",
"gonicVersion": "v0.7.5",
"searchResult2": {
"artist": [
{

View File

@@ -95,7 +95,7 @@ func Scrobble(apiKey, secret, session string, opts ScrobbleOpts) error {
params.Add("track", opts.Track.TagTitle)
params.Add("trackNumber", strconv.Itoa(opts.Track.TagTrackNumber))
params.Add("album", opts.Track.Album.TagTitle)
params.Add("mbid", opts.Track.Album.TagBrainzID)
params.Add("mbid", opts.Track.TagBrainzID)
params.Add("albumArtist", opts.Track.Artist.Name)
params.Add("api_sig", getParamSignature(params, secret))
_, err := makeRequest("POST", params)

View File

@@ -1,5 +1,5 @@
// generated by `_do_bump_version` script in project root
// Sun Mar 1 21:12:50 GMT 2020
// Tue Mar 3 12:30:20 GMT 2020
// DO NOT EDIT
package version
@@ -8,4 +8,4 @@ const NAME = "gonic"
const NAME_UPPER = "GONIC"
const NAME_EMBED = "gonicembed"
const NAME_SCAN = "gonicscan"
const VERSION = "v0.7.4"
const VERSION = "v0.7.5"