mirror of https://github.com/miraclx/freyr-js
fix(meta): use correct total disc number count (#634)
This commit is contained in:
parent
cd414abddf
commit
437c505e54
32
README.md
32
README.md
|
|
@ -50,22 +50,22 @@ Depending on the URLs you provide freyr, it will;
|
|||
|
||||
Here's a list of the metadata that freyr can extract from each streaming service:
|
||||
|
||||
| Meta | Spotify | Apple Music | Deezer |
|
||||
| :------------: | :-----: | :---------: | :----: |
|
||||
| `Title` | ✔ | ✔ | ✔ |
|
||||
| `Artist` | ✔ | ✔ | ✔ |
|
||||
| `Composer` | ✗ | ✔ | ✔ |
|
||||
| `Album` | ✔ | ✔ | ✔ |
|
||||
| `Genre` | ✗ | ✔ | ✔ |
|
||||
| `Track Number` | ✔ | ✔ | ✔ |
|
||||
| `Disk Number` | ✔ | ✔ | ✔ |
|
||||
| `Release Date` | ✔ | ✔ | ✔ |
|
||||
| `Rating` | ✔ | ✔ | ✔ |
|
||||
| `Album Artist` | ✔ | ✔ | ✔ |
|
||||
| `ISRC` | ✔ | ✔ | ✔ |
|
||||
| `Label` | ✔ | ✔ | ✔ |
|
||||
| `Copyright` | ✔ | ✔ | ✗ |
|
||||
| `Cover Art` | ✔ | ✔ | ✔ |
|
||||
| Meta | Spotify | Apple Music | Deezer |
|
||||
| :------------: | :-----: | :---------: | :---------------: |
|
||||
| `Title` | ✔ | ✔ | ✔ |
|
||||
| `Artist` | ✔ | ✔ | ✔ |
|
||||
| `Composer` | ✗ | ✔ | ✔ |
|
||||
| `Album` | ✔ | ✔ | ✔ |
|
||||
| `Genre` | ✗ | ✔ | ✔ |
|
||||
| `Track Number` | ✔ | ✔ | ✔ |
|
||||
| `Disk Number` | ✔ | ✔ | ✔ (no total) |
|
||||
| `Release Date` | ✔ | ✔ | ✔ |
|
||||
| `Rating` | ✔ | ✔ | ✔ |
|
||||
| `Album Artist` | ✔ | ✔ | ✔ |
|
||||
| `ISRC` | ✔ | ✔ | ✔ |
|
||||
| `Label` | ✔ | ✔ | ✔ |
|
||||
| `Copyright` | ✔ | ✔ | ✗ |
|
||||
| `Cover Art` | ✔ | ✔ | ✔ |
|
||||
|
||||
## Support the project
|
||||
|
||||
|
|
|
|||
2
cli.js
2
cli.js
|
|
@ -1108,7 +1108,7 @@ async function init(packageJson, queries, options) {
|
|||
album: track.album, // ©alb
|
||||
genre: (genre => (genre ? genre.concat(' ') : ''))((track.genres || [])[0]), // ©gen | gnre
|
||||
tracknum: `${track.track_number}/${track.total_tracks}`, // trkn
|
||||
disk: `${track.disc_number}/${track.disc_number}`, // disk
|
||||
disk: `${track.disc_number}${track.total_discs ? `/${track.total_discs}` : ''}`, // disk
|
||||
year: new Date(track.release_date).toISOString().split('T')[0], // ©day
|
||||
compilation: track.compilation, // ©cpil
|
||||
gapless: options.gapless ?? false, // pgap
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@ export default class AppleMusic {
|
|||
total_tracks: albumInfo.ntracks,
|
||||
release_date: albumInfo.release_date,
|
||||
disc_number: trackInfo.attributes.discNumber,
|
||||
total_discs: albumInfo.tracks.reduce((acc, track) => Math.max(acc, track.attributes.discNumber), 1),
|
||||
contentRating: trackInfo.attributes.contentRating,
|
||||
isrc: trackInfo.attributes.isrc,
|
||||
genres: trackInfo.attributes.genreNames,
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ export default class Spotify {
|
|||
total_tracks: albumInfo.ntracks,
|
||||
release_date: albumInfo.release_date,
|
||||
disc_number: trackInfo.disc_number,
|
||||
total_discs: albumInfo.tracks.reduce((acc, track) => Math.max(acc, track.disc_number), 1),
|
||||
contentRating: trackInfo.explicit === true ? 'explicit' : 'inoffensive',
|
||||
isrc: (trackInfo.external_ids || {}).isrc,
|
||||
genres: albumInfo.genres,
|
||||
|
|
|
|||
Loading…
Reference in New Issue