-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lookup_release_by_id: can't include recordings #9
Comments
This is probably related to #1 |
Some further information below library(musicbrainz)
the_wall_mbid <- search_releases("The Wall AND artist:Pink Floyd",1)$mbid
#> Returning releases 1 to 1 of 109
# using internal function that would be called by lookup_release_by_id
the_wall <- musicbrainz:::lookup_by_id("release", the_wall_mbid, "recordings")
# nothing is returned under recordings
the_wall$recordings
#> NULL
# but the recordings are included under media
cd1_tracks <- purrr::pluck(the_wall, "media", 1, "tracks")
purrr::map_chr(cd1_tracks, ~ purrr::pluck(.x, "recording", "id"))
#> [1] "1be4459a-4bda-4530-bf8e-421fdddbdbfc"
#> [2] "eff36e5e-5abb-4f7e-a0aa-64c154c5b28d"
#> [3] "82d8444b-3478-480c-8652-bf8aa6cb3dc5"
#> [4] "84978bae-46e2-4d9d-b390-5bd8a1c31983"
#> [5] "597eae0b-ccb6-4076-b997-0ce940586076"
#> [6] "2423ca5e-99d3-4b49-be53-542e6ee38a82"
#> [7] "bb0d3c16-b684-4a5a-a107-e12bbd4f3041"
#> [8] "b56432a2-6231-4c6f-af00-2656804a95d1"
#> [9] "919dd9f4-cd78-4359-8e89-195abd9b79cf"
#> [10] "7003ec02-7bc2-4054-b477-f739efd6df45"
#> [11] "c0a217dc-4c2c-45f9-afd4-9b5f366386ef"
#> [12] "ae5096a0-4b53-455a-ac9c-0348108208c3"
#> [13] "bc3448ee-53bb-412a-99d6-ea6cc862928a" Created on 2020-10-18 by the reprex package (v0.3.0) Session infodevtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 3.6.3 (2020-02-29)
#> os macOS Mojave 10.14.6
#> system x86_64, darwin15.6.0
#> ui X11
#> language (EN)
#> collate en_GB.UTF-8
#> ctype en_GB.UTF-8
#> tz Europe/London
#> date 2020-10-18
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date lib source
#> assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0)
#> backports 1.1.10 2020-09-15 [1] CRAN (R 3.6.2)
#> callr 3.4.4 2020-09-07 [1] CRAN (R 3.6.2)
#> cli 2.0.2 2020-02-28 [1] CRAN (R 3.6.0)
#> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0)
#> curl 4.3 2019-12-02 [1] CRAN (R 3.6.0)
#> desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.0)
#> devtools 2.3.2 2020-09-18 [1] CRAN (R 3.6.2)
#> digest 0.6.25 2020-02-23 [1] CRAN (R 3.6.0)
#> dplyr 1.0.2 2020-08-18 [1] CRAN (R 3.6.2)
#> ellipsis 0.3.1 2020-05-15 [1] CRAN (R 3.6.2)
#> evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.0)
#> fansi 0.4.1 2020-01-08 [1] CRAN (R 3.6.0)
#> fs 1.5.0 2020-07-31 [1] CRAN (R 3.6.2)
#> generics 0.0.2 2018-11-29 [1] CRAN (R 3.6.0)
#> glue 1.4.2 2020-08-27 [1] CRAN (R 3.6.2)
#> highr 0.8 2019-03-20 [1] CRAN (R 3.6.0)
#> htmltools 0.5.0 2020-06-16 [1] CRAN (R 3.6.2)
#> httr 1.4.2 2020-07-20 [1] CRAN (R 3.6.2)
#> jsonlite 1.7.1 2020-09-07 [1] CRAN (R 3.6.2)
#> knitr 1.30 2020-09-22 [1] CRAN (R 3.6.2)
#> lifecycle 0.2.0 2020-03-06 [1] CRAN (R 3.6.0)
#> magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0)
#> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.0)
#> musicbrainz * 0.0.0.9000 2020-10-18 [1] local
#> pillar 1.4.6 2020-07-10 [1] CRAN (R 3.6.2)
#> pkgbuild 1.1.0 2020-07-13 [1] CRAN (R 3.6.2)
#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 3.6.0)
#> pkgload 1.1.0 2020-05-29 [1] CRAN (R 3.6.2)
#> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.0)
#> processx 3.4.4 2020-09-03 [1] CRAN (R 3.6.2)
#> ps 1.3.4 2020-08-11 [1] CRAN (R 3.6.2)
#> purrr 0.3.4 2020-04-17 [1] CRAN (R 3.6.2)
#> R6 2.4.1 2019-11-12 [1] CRAN (R 3.6.0)
#> ratelimitr 0.4.1 2018-10-07 [1] CRAN (R 3.6.0)
#> remotes 2.2.0 2020-07-21 [1] CRAN (R 3.6.2)
#> rlang 0.4.7 2020-07-09 [1] CRAN (R 3.6.2)
#> rmarkdown 2.4 2020-09-30 [1] CRAN (R 3.6.3)
#> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.0)
#> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0)
#> stringi 1.5.3 2020-09-09 [1] CRAN (R 3.6.2)
#> stringr 1.4.0 2019-02-10 [1] CRAN (R 3.6.0)
#> testthat 2.3.2 2020-03-02 [1] CRAN (R 3.6.0)
#> tibble 3.0.3 2020-07-10 [1] CRAN (R 3.6.2)
#> tidyr 1.1.2 2020-08-27 [1] CRAN (R 3.6.2)
#> tidyselect 1.1.0 2020-05-11 [1] CRAN (R 3.6.2)
#> usethis 1.6.3 2020-09-17 [1] CRAN (R 3.6.2)
#> vctrs 0.3.4 2020-08-29 [1] CRAN (R 3.6.2)
#> withr 2.3.0 2020-09-22 [1] CRAN (R 3.6.2)
#> xfun 0.18 2020-09-29 [1] CRAN (R 3.6.2)
#> yaml 2.2.1 2020-02-01 [1] CRAN (R 3.6.0)
#>
#> [1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library |
Thank you for reporting this. The bug appeared with the stricter control in With regards to The Wall, you should be looking for release groups and then releases within them. library(musicbrainz)
library(tidyverse)
pf_id <- search_artists("Pink Floyd",1)$mbid
tw_rg_id <- browse_release_groups_by("artist", pf_id) %>%
filter(str_detect(title, "Wall")) %>%
pull(mbid)
tw_r <- browse_releases_by("release-group", tw_rg_id)
tw_r %>% View It is true that release will have media associated with it, but i am not currently pulling it. Feel free to add parser for it and PR a |
Thanks @dmi3kno. Regarding The Wall, I was using that example because it's present in the The main issue is that During the call to |
It is true that lookup release by ID allows recordings as a valid include. That is what documentation says you can query. Medium is NOT the same as recording according to musicbrainz. The help page on Recording contains examples of different Recordings of the same track (live vs studio, original vs remix) for Moby and Abba. Here's my example (from amazing Norwegian Emilie Nicolas) pulled with library(musicbrainz)
library(tidyverse)
gu_recs <- search_recordings("Grown+Up AND artist:Emilie+Nicolas") %>%
filter(score==100)
gu_recs %>% unnest(releases, names_sep = "_") or full information about each release (as supplied in the includes) map_dfr(gu_recs$mbid, lookup_recording_by_id, includes="releases") %>%
unnest(releases, names_sep="_") %>% View Question is how to get to recordings from releases and that is a good question gu_releases <- gu_recs %>% unnest(releases, names_sep = "_") %>%
pull(releases_release_mbid) %>%
map_dfr(lookup_release_by_id, includes="recordings") But includes do not supply recordings (also directly in JSON) gu_releases %>%
unnest(recordings, names_sep="_") The proper way of doing it would be to pull a release (if not a release group), then extract media, parse through tracks and pick out recording information. But in any case, there will be only one single record per track (because the track represents only 1 version of the song). So as I said, we probably lack a functionality of extracting media per release (or release group), fair enough, but so far I did not consider this to be the task within a scope for a number of reasons:
|
Thanks @dmi3kno. It just seemed confusing to me as a user that you could set In relation to getting recordings from a release, I notice that if just
To me, getting the recordings for a release seems like a useful thing to be able to do, partly because of the wealth of information that's associated with the recording, particularly in relationships for associated performers and works. It's also very handy for classical music where the main performers are listed as the recording artist rather than the track artist, which is used for the composer. If I get time and can get my head around the necessary parsing then I will try to add a PR. Thanks for your time and for writing this package. |
Thanks for writing this package.
It seems that using
lookup_release_by_id(mbid, includes = c("recordings"))
doesn't actually get any recordings. Please see the reprex below.library(musicbrainz)
This gives some recordings:
This doesn't give any recordings, but I would've expected to get the recordings that make up the release.
Created on 2020-09-16 by the reprex package (v0.3.0)
Session info
The text was updated successfully, but these errors were encountered: