feat(S04/T01): Added DiscNumber field to MBTrack (populated from Medium…
- backend/explore/types.go - backend/explore/musicbrainz.go - frontend/wailsjs/go/explore/Service.d.ts - frontend/index.ts
This commit is contained in:
@@ -388,10 +388,11 @@ func convertRelease(r musicbrainzws2.Release) MBRelease {
|
|||||||
for _, m := range r.Media {
|
for _, m := range r.Media {
|
||||||
for _, t := range m.Tracks {
|
for _, t := range m.Tracks {
|
||||||
rel.Tracks = append(rel.Tracks, MBTrack{
|
rel.Tracks = append(rel.Tracks, MBTrack{
|
||||||
Position: t.Position,
|
Position: t.Position,
|
||||||
Title: t.Title,
|
DiscNumber: m.Position,
|
||||||
Length: int(t.Length.Milliseconds()),
|
Title: t.Title,
|
||||||
MBID: string(t.ID),
|
Length: int(t.Length.Milliseconds()),
|
||||||
|
MBID: string(t.ID),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,10 +59,11 @@ type MBRecording struct {
|
|||||||
|
|
||||||
// MBTrack is a Wails-friendly projection of a MusicBrainz track.
|
// MBTrack is a Wails-friendly projection of a MusicBrainz track.
|
||||||
type MBTrack struct {
|
type MBTrack struct {
|
||||||
Position int `json:"position"`
|
Position int `json:"position"`
|
||||||
Title string `json:"title"`
|
DiscNumber int `json:"discNumber"`
|
||||||
Length int `json:"length"`
|
Title string `json:"title"`
|
||||||
MBID string `json:"mbid"`
|
Length int `json:"length"`
|
||||||
|
MBID string `json:"mbid"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LBTopRecording represents a popular recording from the
|
// LBTopRecording represents a popular recording from the
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import '@components/library-filter/library-filter.ts';
|
|||||||
import '@components/track-details/track-details.ts';
|
import '@components/track-details/track-details.ts';
|
||||||
import '@components/explore-view/explore-view.ts';
|
import '@components/explore-view/explore-view.ts';
|
||||||
import '@components/explore-artist-details/explore-artist-details.js';
|
import '@components/explore-artist-details/explore-artist-details.js';
|
||||||
|
import '@components/explore-album-details/explore-album-details.js';
|
||||||
import '@awesome.me/webawesome/dist/styles/themes/default.css';
|
import '@awesome.me/webawesome/dist/styles/themes/default.css';
|
||||||
import '@awesome.me/webawesome/dist/components/icon/icon.js';
|
import '@awesome.me/webawesome/dist/components/icon/icon.js';
|
||||||
import { setBasePath } from '@awesome.me/webawesome/dist/webawesome.js';
|
import { setBasePath } from '@awesome.me/webawesome/dist/webawesome.js';
|
||||||
@@ -176,6 +177,16 @@ document.addEventListener('navigate', (e: Event) => {
|
|||||||
currentDetailEl = el;
|
currentDetailEl = el;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'explore-album-details': {
|
||||||
|
const { releaseGroupMBID, albumName } = detail;
|
||||||
|
const el = document.createElement('explore-album-details');
|
||||||
|
|
||||||
|
el.setAttribute('release-group-mbid', releaseGroupMBID);
|
||||||
|
el.setAttribute('album-name', albumName);
|
||||||
|
mainContent.appendChild(el);
|
||||||
|
currentDetailEl = el;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
const fallback = document.createElement('div');
|
const fallback = document.createElement('div');
|
||||||
|
|
||||||
|
|||||||
+1
@@ -41,6 +41,7 @@ export interface MBRelease {
|
|||||||
|
|
||||||
export interface MBTrack {
|
export interface MBTrack {
|
||||||
position: number;
|
position: number;
|
||||||
|
discNumber: number;
|
||||||
title: string;
|
title: string;
|
||||||
length: number;
|
length: number;
|
||||||
mbid: string;
|
mbid: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user