Giter Club home page Giter Club logo

droptune-og's Introduction

Archived

This was the original codebase for Droptune, now archived for posterity sake.

About

Droptune is new music notifications for your favorite artists. It's something I've (@Shpigford) personally wanted to see exist for as long as I've been listening to music (i.e. forever). I don't passively listen to music. I don't just fire up some radio station or random playlist and listen to whatever is on. I choose what music I listen to and follow artists I love.

In that vein, I always want to know when those artists I love release new music, new music videos, news and whatever else they put out.

Unfortunately, that's a difficult task. I consume content from artists across multiple platforms (Spotify, Apple Music, YouTube, etc). But none of those platform accurately and consistently surface new music. They use fancy algorithms and content editors to surface music they "think" you'll want, instead of just showing it all, ultimately meaning you miss out on a lot.

On top of that, they don't surface the non-audio content (such as news articles and music videos).

So, what Droptune does is centralize all of that. New music, new videos, news and more, all for the artists that I choose to follow, so I never miss beat.

Codebase

The codebase is vanilla Rails, Sidekiq w/ Redis, Puma, Postgres. Quite a simple setup.

How to start

1. You'll need to pull down the repo locally. You can use GitHub's "Clone or download" button to make that happen.

2. Then, add a config file to config/application.yml, using config/application.yml.sample as your template.

Twitter

Twitter credentials are needed for authentication. You'll need to have a Developer account and create your own app, which is free: https://developer.twitter.com

Make sure to set the Callback URL to http://localhost:5000/users/auth/twitter/callback. You will also need to set a Terms of Service URL, a Privacy Policy URL. Then make sure to check "Request email address" on the permissions page.

Spotify

For Spotify, you'll also need a Developer account and create your own app, which is also free: https://developer.spotify.com

Make sure to set the Redirect URI to http://localhost:5000/users/auth/spotify/callback

These will get you the necessary keys for the app to fully function.

Apple Music

Apple doesn't make this easy. Actually setting this up isn't necessary for base functionality, but obviously if you'd like the Apple Music portions of this to work, you'll need to set this up. You need an Apple Developer account (which isn't free).

You'll need 3 bits from your Apple Developer account:

IMVDb

Not required, but necessary to import music video data. Create a free IMVDb developer account here: https://imvdb.com/developers/api

You'll need to register an app and use the generated Application Key for imvdb_key.

3. In the command line, you'll then run the following to set up gems and the database...

$ bin/setup # Installs the necessary gems and sets up the database

4. Finally, start the server (also in the command line)!

$ foreman start # starts webserver and background jobs

If you don't already have foreman installed, you can install it with gem install foreman

Contributing

It's still very early days for this so your mileage will vary here and lots of things will break.

But almost any contribution will be beneficial at this point.

If you've got an improvement, just send in a pull request. If you've got feature ideas, simply open a new issues!

License & Copyright

Released under the MIT license, see the LICENSE file. Copyright (c) Sabotage Media LLC.

droptune-og's People

Contributors

bsharpe avatar danielwestendorf avatar dependabot-support avatar dinubs avatar fabiogiolito avatar mtclmn avatar rimenes avatar shpigford avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

droptune-og's Issues

Ability to unfollow artists

Users should be able to unfollow artists. Many times a user may have a few songs from an artist in their saved tracks, but not actually want to know when they release new music.

We should allow them to stop following that artist.

Show "decades" in album year navigation

Currently you can view older album releases by year. But really, anything over 10 years ago we should just reduce to the decade instead of a single year.

ie.

  • 2000's
  • 1990's
  • 1980's
  • 1970's

screen shot 2018-08-13 at 10 25 00 am

Highlight releases that I'm likely to really care about

I'm not sure what the right solution to this is, but I thought I'd open an issue talking about the problem from my perspective to start a discussion.

Apple Music is really poor at surfacing new albums from artists that I would like, even though it has 11 years of my listening data. Droptune is great because it shows me everything, but this is now a bit too much. When I started I got a lot of classical music because I had a few classical artists in my collection, even though I haven't listened to them for years. I found that if I unfollowed them that cleaned up my recommendations, but many people probably won't want to do that much curation.

It would be great if Droptune could look at my listening history and highlight in some way the albums that I am most likely to care about, and maybe deemphasise the ones I'm less likely to care about.

Some ideas:

  • Track which albums are new since the last time I opened the Droptune homepage and add a desaturation filter to the ones I've seen before, to just highlight what's new
  • Add a badge or bold text to the albums from artists which have high frecency (frequency/recency)
  • Add multiple 'tracks' in the list of new albums, with a hotlist track at the top for the albums that Droptune thinks you'll be most interested in
  • Add thumbs up/down buttons on each album to help tune suggestions
  • Add filtering buttons to the homepage for showing singles and collections. These are currently in the settings and so aren't easy to quickly turn off and on.
  • Add section headers by week (This week, last week, two weeks ago) to help group the albums and make them easier to scan.

Coheed and Cambria: Some albums are semi-duplicated.

Reduce Spotify API calls

A major bottleneck in our data processing is Spotify.

Checking for new music is very resource intensive as the only way (that I'm aware of) to do it is to loop through every single artist, then loop through every one of that artist's albums to see if any are new.

This means a single artist can generate dozens if not hundreds of individual jobs and calls to the Spotify API.

Even if we can't figure out a workaround with the Spotify API itself, maybe there's a clever way to decide when an artist actually needs updated.

i.e. An artist that hasn't released anything in 30 years has a relatively low chance of releasing something now...yet we still check them every. single. day.

Email summaries

We should send daily/weekly/monthly email summaries of new releases.

Progressively load Artists

Right now we load all of a given users followed artists in one big swoop. That's craziness.

It should progressively load them as they scroll.

Paginate Artist listing

Loading every artist in the first view is...silly.

We should paginate the view or at least progressively load as you scroll.

Top Albums page

Show the top albums based on artists with the most followers.

500 Error for Apple Music Sync

I had previously signed up as flybayer and connected Apple Music and Spotify. I was getting a bunch of new music I didn't care about from my Spotify graveyard. So to remove all those I canceled my Droptune account, and then created a new one with the same Twitter.

Right after first login to the new account, the Apple Music button says "Refresh Apple Music Library" instead of "Connect".

When I click "Refresh Apple Music Library" the button text changes to "Scanning .." but the API call returns a 500 error.

Looks like I hit an unexpected edge case 😬

Wrong username being displayed

Each time I refresh the page I see a new name on the navbar. Seems like logged username is being cached and I'm being served someone's cache.

image

How to get around needing OAuth tokens for local dev?

So, getting this up and running locally requires you to have Twitter and Spotify tokens/keys...which makes it a bit of a hassle for anyone other than me to work on it.

Namely, you'd have to go set up your own Twitter and Spotify apps.

Anyone have some ideas on how to get around that?

Add item commenting

Would like to start adding some community features around items. First order of business will be commenting.

These items should allow commenting...

  • Artist
  • Album
  • Music Video

New music suggesterizer

Could be fun to make a tool that suggests new artists/albums/tracks to you based on your library/listening history.

We show one item at a time with a 30-second clip...you think give it a thumbs up/down and go to the next.

Might be a neat way to quickly find new artists you love.

Create a custom Spotify playlist of recent releases

I think this would be absolutely rad. Would be a nice to be able to just hit play and listen to the new music, instead of going to each album/single individually. Maybe offer the ability to e.g. filter out singles, include the full album in the playlist vs only X number of songs, and other customizations?

Spotify's API allows playlist creation and management. Not sure if Apple Music allows something similar, as I don't use it often, but that would be ideal.

Could probably use something like sidekiq-cron with sidekiq-unique-jobs to run a daily worker that keeps the playlist up to date (not 100% sure how things are currently set up but I'll dig in soon).

Connections section in settings should reflect reality

(This is not intended as a criticism; rather I'm hoping that pointing out potentially confusing UX issues is helpful πŸ˜„)

Currently, the Connections section in settings does not update to reflect if a service is already connected. I've connected Spotify, but I'm still offered the option to... connect Spotify πŸ˜…

image

N.B. I also noticed that when initially connecting a service as prompted after signing in with Twitter, I was flashed a success message, but also still saw the prompt to connect. I didn't get a screenshot of that, though.

Implement Apple Music support using MusicKit

Apple's MusicKit JS library allows authenticating in the browser and, in turn, pulling in a user's Apple Music library!

https://developer.apple.com/documentation/musickitjs/

Given it's completely javascript based, the user would need to leave their browser window open while we iterated through their library to get their "saved artists", but that'd be relatively quick, and then we could go through the process of pulling album details and what not on the backend.

In my head the way this works is...

  1. User authenticates with MusicKit JS
  2. We hit the music.api.library.artists endpoint
  3. Paginate through the results (which gives us the iTunes ID and the artist name)
  4. Send those results to the backend in groups to be processed using Sidekiq
  5. Sidekiq goes through each artist and calls the iTunes API to pull a given artists album library
  6. That data is then saved to Droptune database just like Spotify
  7. $$$$

Spotify embed is not embedded

This morning I noticed that album views do not seem to have a Spotify embed, whereas I recall them having that the list time I used Droptune.

I also noticed a js error in the devtools console; not sure if it's related:

image

Should there be a Spotify embed on this page? If so, is there anything I can do to help debug this further?

Rss feed of new albums

Add a Rss feed to get new albums (still follow blogs for this reason!). (Happy to spend some time on it soon.)

Get recently played tracks from Apple Music

Currently only possible via Last.fm.

You can almost do it with the Apple Music API: https://developer.apple.com/documentation/applemusicapi/get_recently_played_resources

Unfortunately, that seems to only return high level "resources"...albums and playlists that the track is in vs. the track itself. :(

Example output...

{
   "next":"/v1/me/recent/played?offset=5",
   "data":[
      {
         "id":"pl.u-PPzgCgAeNB",
         "type":"playlists",
         "href":"/v1/catalog/us/playlists/pl.u-PPzgCgAeNB",
         "attributes":{
            "lastModifiedDate":"2018-09-05T16:00:08Z",
            "curatorName":"Josh Pigford",
            "url":"https://itunes.apple.com/us/playlist/the-chillest/pl.u-PPzgCgAeNB",
            "name":"The Chillest",
            "artwork":{
               "width":2400,
               "height":2400,
               "url":"https://is1-ssl.mzstatic.com/image/thumb/wWP_am462ukU5WVcCDbGlQ/{w}x{h}bb.jpeg",
               "bgColor":"030301",
               "textColor1":"ffffff",
               "textColor2":"ecd8c0",
               "textColor3":"cccccc",
               "textColor4":"bdad9a"
            },
            "playParams":{
               "id":"pl.u-PPzgCgAeNB",
               "kind":"playlist"
            },
            "playlistType":"user-shared"
         }
      },
      {
         "id":"pl.u-YG4gILagje",
         "type":"playlists",
         "href":"/v1/catalog/us/playlists/pl.u-YG4gILagje",
         "attributes":{
            "lastModifiedDate":"2018-09-01T05:02:10Z",
            "curatorName":"Josh Pigford",
            "description":{
               "standard":"New music from Droptune"
            },
            "url":"https://itunes.apple.com/us/playlist/droptune-new-music/pl.u-YG4gILagje",
            "name":"Droptune New Music",
            "artwork":{
               "width":2400,
               "height":2400,
               "url":"https://is3-ssl.mzstatic.com/image/thumb/zj5eQwvrRwkHWWRov0zjng/{w}x{h}bb.jpeg",
               "bgColor":"000000",
               "textColor1":"e9ede5",
               "textColor2":"f0ead2",
               "textColor3":"babdb7",
               "textColor4":"c0bba8"
            },
            "playParams":{
               "id":"pl.u-YG4gILagje",
               "kind":"playlist"
            },
            "playlistType":"user-shared"
         }
      },
      {
         "id":"pl.u-Z6xpIq5VvL",
         "type":"playlists",
         "href":"/v1/catalog/us/playlists/pl.u-Z6xpIq5VvL",
         "attributes":{
            "lastModifiedDate":"2018-08-24T00:12:25Z",
            "curatorName":"Josh Pigford",
            "url":"https://itunes.apple.com/us/playlist/workout/pl.u-Z6xpIq5VvL",
            "name":"Workout",
            "artwork":{
               "width":2400,
               "height":2400,
               "url":"https://is2-ssl.mzstatic.com/image/thumb/TbAU2TmN3LepW9JZ7Z8Rrw/{w}x{h}bb.jpeg",
               "bgColor":"1c1616",
               "textColor1":"ffffff",
               "textColor2":"fcfdeb",
               "textColor3":"d1d0d0",
               "textColor4":"cfcfc0"
            },
            "playParams":{
               "id":"pl.u-Z6xpIq5VvL",
               "kind":"playlist"
            },
            "playlistType":"user-shared"
         }
      },
      {
         "id":"1396292262",
         "type":"albums",
         "href":"/v1/catalog/us/albums/1396292262",
         "attributes":{
            "artwork":{
               "width":3670,
               "height":3670,
               "url":"https://is1-ssl.mzstatic.com/image/thumb/Music125/v4/90/bc/c6/90bcc6d6-a0c8-3a71-b10a-4840f8563d22/00602567721598.rgb.jpg/{w}x{h}bb.jpeg",
               "bgColor":"0b0b0b",
               "textColor1":"dedede",
               "textColor2":"c6c6c6",
               "textColor3":"b4b4b4",
               "textColor4":"a1a1a1"
            },
            "artistName":"Troye Sivan",
            "isSingle":false,
            "url":"https://itunes.apple.com/us/album/bloom/1396292262",
            "isComplete":true,
            "genreNames":[
               "Pop",
               "Music",
               "Rock"
            ],
            "trackCount":10,
            "isMasteredForItunes":true,
            "releaseDate":"2018-08-31",
            "name":"Bloom",
            "recordLabel":"EMI Recorded Music Australia Pty Ltd",
            "copyright":"An EMI Music Australia production; β„— 2018 Universal Music Australia Pty Ltd.",
            "playParams":{
               "id":"1396292262",
               "kind":"album"
            },
            "editorialNotes":{
               "short":"The pop star’s warm second album celebrates love and self-discovery."
            },
            "contentRating":"explicit"
         }
      },
      {
         "id":"1312021964",
         "type":"albums",
         "href":"/v1/catalog/us/albums/1312021964",
         "attributes":{
            "artwork":{
               "width":3000,
               "height":3000,
               "url":"https://is2-ssl.mzstatic.com/image/thumb/Music118/v4/46/ca/10/46ca1035-cefb-bcd4-ea4f-ac8679c23ad8/UMG_cvrart_00602567232056_01_RGB72_3000x3000_17UM1IM44608.jpg/{w}x{h}bb.jpeg",
               "bgColor":"0c000c",
               "textColor1":"dbbbe7",
               "textColor2":"df9e72",
               "textColor3":"b296bb",
               "textColor4":"b57e5e"
            },
            "artistName":"Fickle Friends",
            "isSingle":false,
            "url":"https://itunes.apple.com/us/album/you-are-someone-else/1312021964",
            "isComplete":true,
            "genreNames":[
               "Pop",
               "Music",
               "Pop/Rock",
               "Rock",
               "Electronic"
            ],
            "trackCount":16,
            "isMasteredForItunes":true,
            "releaseDate":"2018-03-16",
            "name":"You Are Someone Else",
            "recordLabel":"Polydor",
            "copyright":"β„— 2018 Polydor Records, a division of Universal Music Operations Limited",
            "playParams":{
               "id":"1312021964",
               "kind":"album"
            },
            "contentRating":"explicit"
         }
      }
   ]
}

Let users submit music videos

There’s not a great source of actively updated music video data. Allow users to submit recent videos which an admin can approve.

Label "Singles" vs "Albums"

Cool project, @Shpigford!
One frustration I had with Spotify is their lack of labeling "singles" as such in New Releases.
Apple Music does a much better job of this, but it would be great to have consistent labels as to whether a new release is a single.

Allow Album Favoriting

Let users "favorite" or "love/heart" an album. Use case that seems really interesting is ranking Upcoming albums to see which ones people are most excited about.

Privacy settings

I was slightly surprised to see that all of my music preferences are publicly visible to everyone. It's not a huge deal for me, but it would probably be good to make that clearer to people, and also to give them the option (maybe the default?) for their profile and music preferences to be private. A music collection could reveal a lot of information about somebody, so people should be able to make a choice about it.

(I realise that this is all super early and I'm not upset/grumpy about this missing feature, just adding it as something to think about for the future).

Add quick play button directly from album view

Would be cool if you could e.g. click the Spotify icon on the album cover to open directly in Spotify and start listening to the album without having to click through to the album then to the Spotify embed.

Progressively load older albums

The Latest Music Releases page currently just loads in new albums from the past 3 weeks (which is a bit arbitrary).

I'd like to lower that to past 7 days, then let you scroll down and load more albums/dates as you scroll.

Can't sign up with Twitter or Spotify

After signing up with Twitter (OAuth succeeded), I'm given sign up options again, which makes it seem like the registration failed (i.e. I'm not signed in and asked to sign up again):

image

Then when I try to sign in with Twitter, it redirects me back to the same page after the successful OAuth. When I choose Spotify, I get a 406 Not Acceptable HTTP response after a successful OAuth flow. I've tried revoking the Twitter OAuth access and going through the flow again to no avail.

Duplicates in latest and upcoming releases

I have a bunch of duplicates from apple music in both of these sections. Not sure why. I checked to see if it was because of different types (explicit and clean versions) but that's not it. I have singles and compilations off.

Here is an example from the upcoming release section:

duplicates-1

iOS app

This would be a huge win, primarily so we can let folks connect their Apple Music account.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.