raycast / extensions

Everything you need to extend Raycast.
https://developers.raycast.com
MIT License
5.27k stars 2.97k forks source link

[Music] ... #1861

Closed lazarjov closed 2 years ago

lazarjov commented 2 years ago

Extension – Music

Author: @Rawnly

Description

Error:

Steps To Reproduce

  1. Open Raycast
  2. Run Start Playlist command

The current behavior

'Something went wrong' message

The expected behavior

See a list of available playlists

Raycast version

Version: 1.35.2

thomaspaulmann commented 2 years ago

Can you please add more repro steps? Without that we don't know what to act on.

lazarjov commented 2 years ago

There are only two steps, and the bug occurs.

rawnly commented 2 years ago

@lazarjov can you provide some details about playlists names? I think is a problem with the playlist grouping function, but I can't reproduce the issue. Maybe some weird characters or spacing or just data malformation.

I group playlists based on a property in the that the music app provides, which is the "kind" of playlist (it can be something like user or music I don't remember exactly.)

if it isn't found it should display "Other", but maybe there's a bug.

One thing you can do is to run the following AppleScript and paste the output here, to see if there's some inconsistence in the data returned by the script.

set output to ""
    tell application "Music"
        repeat with selectedPlaylist in  playlists
            set pId to the id of selectedPlaylist
            set pName to the name of selectedPlaylist
            set pDuration to the duration of selectedPlaylist
            set pCount to count (tracks of selectedPlaylist)
            set pTime to the time of selectedPlaylist
            set pKind to the class of selectedPlaylist
            set pDesc to the description of selectedPlaylist
            set output to output & "id=" & pId & "&name=" & pName & "&duration=" & pDuration & "&count=" & pCount & "&time=" & pTime & "&kind=" & pKind & "&description=" & pDesc & ""
        end repeat
    end tell
return output

Also knowing which version of macOS you are running could be helpful.

Thanks

lazarjov commented 2 years ago

I am running macOS Monterey v12.4.

I do have some playlists that start with # or '. I renamed them (or removed them) and nothing changed. Other Music commands work well.

rawnly commented 2 years ago

I do have some playlists that start with # or '. I renamed them (or removed them) and nothing changed. Other Music commands work well.

can you try to run the script i posted?

lazarjov commented 2 years ago

Yup, here is the output:

"id=65&name=Library&duration=459887&count=2029&time=5:07:44:47&kind=library playlist&description=missing valueid=13639&name=Music&duration=459887&count=2029&time=5:07:44:47&kind=user playlist&description=missing valueid=15671&name=Music Videos&duration=3546&count=4&time=59:06&kind=user playlist&description=missing valueid=15681&name=2Pac Essentials&duration=6634&count=24&time=1:50:34&kind=subscription playlist&description=Even though he was taken from us far too soon, 2Pac accomplished more by the age of 25 than most rappers ever will. The son of Black Panthers, he spoke truth to power as an icon of West Coast hip-hop. Whether celebrating women on “Dear Mama” and “Keep Ya Head Up” or flexing battlefield scars on “Hit ‘Em Up” and “Ambitionz Az a Ridah,” Pac's passion burns intensely. He's become even more successful in death, with posthumous albums giving new glimpses into his world. Between a lifelike hologram of Pac at Coachella and the biopic All Eyez On Me, we're still as fascinated with him as ever.id=15708&name=A Smooth Jazz Christmas&duration=14478&count=55&time=4:01:18&kind=subscription playlist&description=Mellow music can be tough to find during the holidays, especially since so much seasonal fare is tailored toward boisterous caroling. Smooth-jazz stars, however, never fail to deliver chilled-out tunes with a refreshing vibe. Featuring laidback takes on pop and R&B holiday hits, this playlist is calibrated to be enjoyed by a roaring fire after all the presents have been unwrapped.id=15766&name=A-List Pop&duration=18097&count=101&time=5:01:37&kind=subscription playlist&description=“‘About Damn Time’ can lead into so many conversations,” Lizzo tells Apple Music of the new disco-indebted single that headlines A-List Pop this week. Her first bit of new music since last year’s Cardi B collaboration “Rumors,” it’s a song that’s meant to inspire some much-needed optimism. “It's about damn time I feel better, it's about damn time we get out this pandemic,” she says. “It's about damn time we get the first Black female Supreme Court justice. It's about damn time we popped the champagne. It's about damn time the tequila got here. There's so many things.” Add A-List Pop to your library to stay up on the latest and greatest pop music.id=15870&name=All Day Dance Party&duration=18295&count=100&time=5:04:55&kind=subscription playlist&description=Who said cutting loose is just for Friday and Saturday nights? With a mix of melodic house, dance pop, and a smattering of trap and tropical beats, these songs keep the mood upbeat 24/7, whether for mornings at the gym or after-work carpool singalongs. We update this playlist regularly. If you like a song, add it to your library.id=15973&name=ALT CTRL&duration=20307&count=100&time=5:38:27&kind=subscription playlist&description=“On ‘Virginia (Wind in the Night),’ we really showcase a wide variety of vocal approaches and vocal range,” The Head and the Heart’s Jonathan Russell tells Apple Music of the song that heads up ALT CTRL this week. It’s a towering highlight from the folk-pop outfit’s just-released LP <i>Every Shade of Blue</i>. “In saying that, every member, not just the singers, really stretch out on this record,” Russell adds. “I’d say it's probably the most bold and vulnerable record we have ever made.” Add ALT CTRL to your library to stay up on the latest and greatest alternative music.id=16076&name=At Home with Run the Jewels: Updated&duration=2407&count=9&time=40:07&kind=user playlist&description=missing valueid=16170&name=Bob Dylan Essentials&duration=15411&count=55&time=4:16:51&kind=subscription playlist&description=missing valueid=16228&name=Bob Marley & The Wailers Essentials&duration=6306&count=25&time=1:45:06&kind=subscription playlist&description=There are a few artists whose entire body of work could be classified as essential. Bob Marley is one of them. And though The Wailers defined roots reggae in the '60s, this playlist emphasizes their crossover contributions from the '70s, when Marley redrew the genre's boundaries with smooth, distorted guitar lines, jubilant rhythms, and even a few hot disco grooves, as on the irresistibly bouncy \"Could You Be Loved.\" Bob's vocals, meanwhile, remain generous and life-affirming: On the slavery-indicting \"Redemption Song,\" his voice wavers as if carrying the burdens of all who are oppressed.id=16303&name=Childish Gambino Essentials&duration=5559&count=21&time=1:32:39&kind=subscription playlist&description=Donald Glover is the kind of guy who makes the rest of us wonder what we're even doing with our lives. Actor, writer, director, comedian, hip-hop artist—he manages to do them all, not in a dilettantish, jack-of-all-trades kind of way but rather in a let's-win-Golden Globes-and-headline-Coachella kind of way. Stand-up chops, slick wordplay and a goofy nasal delivery powered his early Childish Gambino mixtapes and indie albums, but by the time he released 2013's hazy, sunny <I>Because the Internet</I>, he'd come into his own as an MC and singer, largely shedding his jokey persona for a more serious approach. His range and cultural impact have only widened as his subject matter has grown darker, more ambitious, and more curious. <I>\"Awaken, My Love!”</I>, which yielded the falsetto-driven hit “Redbone,” is a neon funk-soul odyssey in the vein of Sly & The Family Stone and George Clinton. And 2018's politically charged “This Is America”—a gospel-assisted commentary on gun violence and racism that pulls no punches—not only earned him Grammys for Song and Record of the Year; they were also the first hip-hop wins for either category.id=16327&name=Classic Rock Essentials&duration=35691&count=142&time=9:54:51&kind=subscription playlist&description=We have radio to thank for inventing classic rock. Conceived as a programming format, it emerged in the ’80s when stations began devoting heavy airtime to a mix of beloved titans from the ’60s and ’70s (The Rolling Stones, Led Zeppelin, Bob Seger) and then-current hitmakers (Tom Petty, John Mellencamp) whose music contains heavy echoes of the vintage stuff. Even when classic rock opens its ranks to ’90s alt-rockers such as Soundgarden, it’s because they sound old-school. In terms of stylistic variety, the format boasts considerable leg room. Classic rock rotation can and does include soaring ballads from Pink Floyd, The Beatles, and Elton John, and even the occasional glam nugget from David Bowie. Yet at the end of the day, the format definitely relies heaviest on thunderous hard-rock anthems perfect for Friday night parties or powering you through your workday.id=16472&name=Classical Concentration&duration=10621&count=49&time=2:57:01&kind=subscription playlist&description=There's something about the precision of classical music that makes it an especially good companion for staying on task. Whether you're studying, cooking, or just getting through the workday, this mix will help keep you focused and clear. Our classical experts regularly rotate these selections. If you like a piece, add it to your library.id=16524&name=Cool Jazz Essentials&duration=24017&count=98&time=6:40:17&kind=subscription playlist&description=Cool jazz describes an alternative to the fiery virtuosity and blinding velocity of the bebop that emerged in the mid-'40s, yet there was nothing glib about music that fit under this large umbrella. The landmark 1953 Miles Davis album <I>Birth of the Cool</I> gave the aesthetic its name—with gorgeously opaque arrangements and a measured swing in response to bebop’s frenzied drive—but musicians were already experimenting with chill atmospheres and relaxed tempos, emphasizing liquid melodic flow as well as chamber-like settings. Horn players like Lee Konitz and Chet Baker adopted airy, silken tones that belied the harmonic sophistication of their lines, which often came in fleet multi-linear tangles. Big-band leaders like Gil Evans and Stan Kenton deployed rich arrangements that stressed gauzy timbres and counterpoint as much as swinging rhythms.id=16625&name=Fleetwood Mac Essentials&duration=5881&count=25&time=1:38:01&kind=subscription playlist&description=Thanks to its emotional complexities, Fleetwood Mac's music only grows richer with familiarity. A central pillar of pop songcraft in the '70s and '80s, they honed a singular sound with their elegant hooks, folksy intimacy, and L.A. harmonies soaring like lonely eagles above the Pacific. The brutally honest “Go Your Own Way” chronicles the dissolution of Lindsey Buckingham's relationship with Stevie Nicks, while the darkly prismatic “Rhiannon” refracts the latter's haunted psyche. The Mac's songs are far more than catchy; they are windows into their makers' souls.id=16653&name=For Body and Mind&duration=3854&count=19&time=1:04:14&kind=subscription playlist&description=Keep your outlook positive and your body powered up.id=16675&name=Get Up! Mix&duration=4812&count=25&time=1:20:12&kind=subscription playlist&description=Whether it’s Monday morning or Friday night, get going with this personalized mix of upbeat music.id=16703&name=good music&duration=9393&count=42&time=2:36:33&kind=user playlist&description=missing valueid=16748&name=Guardians of the Galaxy&duration=6770&count=33&time=1:52:50&kind=subscription playlist&description=Listen to all your favourite songs from Guardians Of The Galaxy!id=16784&name=Guitar Greats Essentials&duration=30070&count=100&time=8:21:10&kind=subscription playlist&description=Pete Townshend smashed them. Jimi Hendrix set them on fire. B.B. King nearly died trying to rescue one from a burning building. And Keith Richards apparently slept with them—which, as he put it, is how he managed to record the riff to “(I Can’t Get No) Satisfaction” in the middle of the night without quite waking up. A great rock guitarist isn’t necessarily a virtuoso, but someone who shifts your understanding of what the instrument can do. So while this playlist pays deference to the fast (Eddie Van Halen), the smooth (Eric Clapton), and the powerful (Jimmy Page), it also makes room for primitives like The Stooges and Nirvana, Dave Davies of The Kinks, and Chuck Berry—players who weren’t flashy, but whose approach introduced sounds nobody had quite heard before. In six strings and a hundred songs, here’s what rock music sounds like. id=16913&name=Jazz Christmas&duration=16971&count=68&time=4:42:51&kind=subscription playlist&description=Whether it’s breezy Rat Pack interpretations, big-band takes on hallowed standards, or piano numbers as delicate as freshly fallen snow, jazz has always been a natural accompaniment to the holidays. Brassy dance tunes for a get-together? A classy soundtrack to dinner? This set covers all the festive bases.id=16984&name=Kendrick Lamar Essentials&duration=6533&count=25&time=1:48:53&kind=subscription playlist&description=In an interview with Apple Music, Kendrick Lamar reflected on his 2015 album <I>To Pimp a Butterfly</I>—in particular, the song “Alright.” It wasn’t that it sold well (it did). It wasn’t that it won awards (it did). It wasn’t even that it broke new ground for where hip-hop might go. For Lamar, the success was that people sang it in the streets. “A lot of people don’t have voices out there,” he said. “So to see them actually express themselves through song, through lyrics that I wrote?” For a kid from Compton whose life was transformed by hip-hop, the fame was nice, but the singing, the spirit, the possibility that his music was opening a cultural inroad for people joining the fight for civil rights—<I>that</I> was real. He might’ve been writing alone. But he was speaking for many.<br> Born in 1987, Lamar grew up under the influence of JAY-Z, Eminem, and 2pac—for the wordplay, for the imagination, for the heart and sense of community. Given its popularity, Lamar’s music can be surprisingly dense, taking shape in winding, album-length narratives (<I>good kid, m.A.A.d city</I>), live-band hybrids of jazz and funk (<I>To Pimp a Butterfly</I>), and quasi-conceptual explorations of self (2017’s Pulitzer Prize-winning <I>DAMN.</I>). Yes, he wants greatness. But he wants it on his own terms. “I’m not doing it to have a good song,” he said. “Or one good rap. Or a good hook, or a good bridge. I want to keep doing it <I>every time</I>, period. And to do it every time you have to challenge yourself, and you have to confirm to yourself—not anybody else—that you’re the best.”id=17012&name=Khalid Essentials&duration=7463&count=36&time=2:04:23&kind=subscription playlist&description=Thanks to the explosive success of lead-up single “Location,” Khalid was already omnipresent on the R&B scene when he released his 2017 debut album, <I>American Teen</I>. His gentle and inviting voice is often laid over sparse instrumentation, giving it room to breathe. On “Reasons,” he weaves melodically through the hollow beat, articulating sadness; “Coaster” is an aching ballad with a light touch of piano tiptoeing underneath Khalid's lilting and emotive lyrics. He picks up his sonic pace, though, when he collaborates with benny blanco and Halsey on the uptempo “Eastside,” where each of them plays off the electronic bounce of the beat.id=17051&name=Logic Essentials&duration=7949&count=32&time=2:12:29&kind=subscription playlist&description=While the Maryland-born Sir Robert Bryson Hall II—who records as Logic—flew to household-name fame on the wings of his 2017 suicide-hotline saga, “1-800-273-8255,” the rapper had been laying down roots as a savvy pop stylist for years. Logic is a fluid collaborator, as comfortable working with a radio-ready Ryan Tedder vocal (“One Day”) as he is trading bars with Pusha T (“Wrist”). But for the best possible introduction to Logic’s energy and worldview, tap into the conversational and confessional “Black SpiderMan.”id=17086&name=Muddy Waters Essentials&duration=2756&count=15&time=45:56&kind=subscription playlist&description=Muddy Waters is Chicago blues. When he came up from Mississippi in the ‘40s, he brought the Delta blues with him and electrified it both literally and figuratively, adding the industrial vibe of the Windy City to come up with searing stompers like “(I'm Your) Hoochie Coochie Man” and “Mannish Boy.” Muddy could sound like sadness personified (the moody, mournful “I Feel Like Going Home”) or come off like a fire-breathing force of nature (the rowdy “I'm Ready”), but whichever way he worked his mojo, he was the undeniable king of the Chicago sound.id=17104&name=Office DJ&duration=27721&count=152&time=7:42:01&kind=subscription playlist&description=There's nothing like a little music to keep the workplace humming. This uptempo, easygoing playlist—covering the best in recent pop, dance, hip-hop, R&B, and more—is designed to carry everyone through from 9 to 5. We regularly update these tunes. If you hear something you like, add it to your library.id=17272&name=Once Upon a Time in... Hollywood&duration=4746&count=29&time=1:19:06&kind=user playlist&description=missing valueid=17304&name=Piano Chill&duration=9180&count=50&time=2:33:00&kind=subscription playlist&description=There’s nothing like the sound of a piano alone. Intimate, ruminative, and relaxed, this mix highlights the sound of solo piano in repose: calm, in 88 keys. Our editors rotate selections regularly, so if you hear something you like, add it to your library.id=17357&name=Pop Throwback&duration=10639&count=50&time=2:57:19&kind=subscription playlist&description=Here’s a time capsule of pop classics that sound as good now as the day they dropped. Whether you’re taking a trip down memory lane or visiting for the first time, let this mix be your guide. Our editors update these selections regularly, so if you hear something you like (whether it’s a forgotten favourite or a new discovery), add it to your library.id=17410&name=pump up&duration=1198&count=6&time=19:58&kind=user playlist&description=missing valueid=17626&name=Quentin’s Beats&duration=8756&count=45&time=2:25:56&kind=user playlist&description=Beats and sounds from the movies by Quentin Tarantinoid=17740&name=Run The Jewels Essentials&duration=3507&count=18&time=58:27&kind=subscription playlist&description=Atlanta rapper Killer Mike burst onto the scene as a musical scion of Outkast on 2000's space-age snare slapper \"Snappin' and Trappin'.\" He launched a solo career in the mid-'00s, and 2006's roiling, organ-driven \"That's Life\" captured his approach: bold, confrontational, politically minded raps rooted in community. When Mike joined producer/rapper EL-P to form Run the Jewels in the early ‘10s, he found a complementary rhyme partner whose aggressive, distorted beats on cuts like \"Blockbuster Night, Pt. 1\" were a perfect match for his pointed bars and bald sense of humor.id=17761&name=Sade Essentials&duration=7779&count=27&time=2:09:39&kind=subscription playlist&description=Led by the restrained but ravishing vocals of Sade Adu, the London-based R&B group Sade cast a spell on pop music with a sound that blends cool jazz with simmering quiet storm ballads. Equally loved by critics and fans, the songs on this playlist continue to seduce new listeners with an enigmatic charisma.id=17868&name=The Last Dance Soundtrack&duration=1978&count=8&time=32:58&kind=user playlist&description=missing valueid=17879&name=The Mandalorian Official Playlist&duration=17378&count=93&time=4:49:38&kind=subscription playlist&description=The Mandalorian and the Child continue their journey, facing enemies and rallying allies as they make their way through a dangerous galaxy in the tumultuous era after the collapse of the Galactic Empire.id=17975&name=The Notorious B.I.G. Essentials&duration=5939&count=22&time=1:38:59&kind=subscription playlist&description=The Notorious B.I.G. was a wholly original rap stylist that paired a punishing, pugilistic flow with an acute sensitivity to language, granting lyrical virtuosity to gigantic, end-of-the-world anthems like “Kick In the Door” or “Who Shot Ya.” His rhymes read like a true crime novel soundtracked by Puffy-driven slabs of heavyweight breaks and crowd-pleasing samples from sources like Diana Ross (“Mo Money Mo Problems”), David Bowie (“Been Around the World”), and the Isley Brothers (“Big Poppa”). Like a tragic hero from a gangster flick, Biggie vividly articulated the game's intense pleasures and pain with stinging attention to detail. Jay Z, Cam'ron, and Lil Kim all benefited from Biggie's influence (and generous cosign), yet he will forever be linked to one rival, Tupac Shakur, in a beef to end all rap beefs. Known to his mother as Christopher Wallace, Biggie died on March 9, 1997 at the age of 24, just 16 days before the release of his second album, Life After Death. Brooklyn's finest claims an indelible seat among the greatest MCs of all time. And if you don't know, now ya know.id=18000&name=The Score&duration=40625&count=187&time=11:17:05&kind=subscription playlist&description=The film composer Hans Zimmer once said that he didn’t write music to tell you what to feel, only that it was time to feel. And as the culture continues to move away from the dominance of the orchestra, scores—for movies, television, and streaming alike—are covering more emotional and stylistic ground than ever, absorbing elements of electronic and pop music in ways that further enrich the interplay between image and sound. With that in mind, here’s a rolling playlist focusing on the best music being written for screens big and small, with a few old favourites thrown in to anchor it. Our editors update selections here weekly, so if you hear something you like, add it to your library.id=18190&name=The Wave&duration=18808&count=99&time=5:13:28&kind=subscription playlist&description=It makes sense that hip-hop and dance music have always had a fruitful dialogue: Both thrive on the beat and were born from the break. Mixing rap features from electronic producers with the more club-oriented side of hip-hop and R&B, this is that point of convergence—and the soundtrack to a seriously fun party. Our editors update selections regularly, so if something moves you, add it to your library."

rawnly commented 2 years ago

The only problem I see there is that the querystring confuses the word R&B with a query param. But this is not causing the crash (i tried editing one of my playlists).

~I'll try adding all those playlists to my library and see what happen. (I hope I can do it via apple script and playlists ids 👀)~

rawnly commented 2 years ago

Unfortunately I can't add those playlist by scripting it. (And honestly those are too many to add manually) Can you check-out this branch and run the dev command to see what happens when you try to "start a playlist"?

lazarjov commented 2 years ago

No worries, I know it's a lot 😅

Can you check-out this branch and run the dev command to see what happens when you try to "start a playlist"?

I am not sure how to go about this. I cloned the repo with this branch, but cannot run the dev command.

rawnly commented 2 years ago

I am not sure how to go about this. I cloned the repo with this branch, but cannot run the dev command.

If u're not comfortable with the environment don't worry. I may have found the problem while trying to address another issue (#1570)

I'll open a new PR in minutes maybe it will fix this one too 🤞

rawnly commented 2 years ago

@lazarjov does it have been fixed?

lazarjov commented 2 years ago

Hey @Rawnly! Yup, just tested it. It works great. Thanks a lot 🙌