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 _, t := range m.Tracks {
|
||||
rel.Tracks = append(rel.Tracks, MBTrack{
|
||||
Position: t.Position,
|
||||
Title: t.Title,
|
||||
Length: int(t.Length.Milliseconds()),
|
||||
MBID: string(t.ID),
|
||||
Position: t.Position,
|
||||
DiscNumber: m.Position,
|
||||
Title: t.Title,
|
||||
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.
|
||||
type MBTrack struct {
|
||||
Position int `json:"position"`
|
||||
Title string `json:"title"`
|
||||
Length int `json:"length"`
|
||||
MBID string `json:"mbid"`
|
||||
Position int `json:"position"`
|
||||
DiscNumber int `json:"discNumber"`
|
||||
Title string `json:"title"`
|
||||
Length int `json:"length"`
|
||||
MBID string `json:"mbid"`
|
||||
}
|
||||
|
||||
// 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/explore-view/explore-view.ts';
|
||||
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/components/icon/icon.js';
|
||||
import { setBasePath } from '@awesome.me/webawesome/dist/webawesome.js';
|
||||
@@ -176,6 +177,16 @@ document.addEventListener('navigate', (e: Event) => {
|
||||
currentDetailEl = el;
|
||||
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: {
|
||||
const fallback = document.createElement('div');
|
||||
|
||||
|
||||
+1
@@ -41,6 +41,7 @@ export interface MBRelease {
|
||||
|
||||
export interface MBTrack {
|
||||
position: number;
|
||||
discNumber: number;
|
||||
title: string;
|
||||
length: number;
|
||||
mbid: string;
|
||||
|
||||
Reference in New Issue
Block a user