{"id":16641988,"url":"https://github.com/artskydj/playlist-combinator","last_synced_at":"2026-06-11T16:31:17.998Z","repository":{"id":23577063,"uuid":"26945174","full_name":"ArtskydJ/playlist-combinator","owner":"ArtskydJ","description":"A thing to mix up users and their playlists","archived":false,"fork":false,"pushed_at":"2015-06-06T01:53:29.000Z","size":163,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-21T02:33:42.456Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArtskydJ.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-21T04:14:17.000Z","updated_at":"2016-01-02T16:58:17.000Z","dependencies_parsed_at":"2022-08-22T02:10:41.517Z","dependency_job_id":null,"html_url":"https://github.com/ArtskydJ/playlist-combinator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Fplaylist-combinator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Fplaylist-combinator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Fplaylist-combinator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Fplaylist-combinator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtskydJ","download_url":"https://codeload.github.com/ArtskydJ/playlist-combinator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243165168,"owners_count":20246720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T07:48:31.121Z","updated_at":"2025-03-12T05:29:07.480Z","avatar_url":"https://github.com/ArtskydJ.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"playlist-combinator\n===================\n\n[![Build Status](https://travis-ci.org/ArtskydJ/playlist-combinator.svg)](https://travis-ci.org/ArtskydJ/playlist-combinator)\n[![Dependency Status](https://david-dm.org/ArtskydJ/playlist-combinator.svg)](https://david-dm.org/ArtskydJ/playlist-combinator)\n[![devDependency Status](https://david-dm.org/ArtskydJ/playlist-combinator/dev-status.svg)](https://david-dm.org/ArtskydJ/playlist-combinator#info=devDependencies)\n\nA javascript module to rotate through multiple users' music queues.\n\n# usage\n\nRun this code:\n```js\nvar playlist = require('playlist-combinator')()\nplaylist.on('error', function (err) {\n\tconsole.log(err)\n})\n\nplaylist.addUser('Wheatley', [ 'accent' ])\nplaylist.addUser('GLaDOS')\n\nplaylist.addSong('GLaDOS', 'potato')\nplaylist.addSong('GLaDOS', 'neurotoxin')\nplaylist.addSong('GLaDOS', 'Caroline')\n```\n\nInternally:\n```js\nuserOrder: ['GLaDOS', 'Wheatley']\nsongs: {\n\t\"Wheatley\": [ 'accent' ],\n\t\"GLaDOS\": [ 'potato', 'neurotoxin', 'Caroline' ]\n}\n```\n\nRun this code:\n```js\nvar song = playlist.getNextSong() //returns =\u003e 'potato'\n```\n\nInternally:\n```js\nuserOrder: ['Wheatley', 'GLaDOS'] //note that GLaDOS was moved to the back; and it's Wheatley's turn next\nsongs: {\n\t\"Wheatley\": [ 'accent' ]\n\t\"GLaDOS\": [ 'neurotoxin', 'Caroline' ]\n}\n```\n\nRun this code:\n```js\nvar song = playlist.getNextSong() //returns =\u003e 'accent'\nvar song = playlist.getNextSong() //returns =\u003e 'neurotoxin'\nvar song = playlist.getNextSong() //returns =\u003e 'Caroline'\n```\n\n\n# api\n\n```js\nvar PlaylistCombinator = require('playlist-combinator')\n```\n\n## `var playlist = PlaylistCombinator()`\n\n### `var song = playlist.getNextSong()`\n\n- Removes the first song from the first user's queue.\n- Moves the first user to the back of the user list.\n- **Returns** the `song` object.\n\n### `var song = playlist.checkNextSong()`\n\nBasically `playlist.getNextSong()` but this does not mutate the playlist.\n\n- **Returns** the first song from the first user's queue.\n\n### `playlist.addSong(userId, song)`\n\n- `userId` is a string. Each user must have their own unique string. The `userId` must have been added via `playlist.addUser(userId)` previous to calling this.\n- `song` is any object.\n\n### `playlist.reorderSong(userId, newArray)`\n\nThis is the suggested way to reorder songs. This is not the suggested way to add or remove songs, although it is completely allowed.\n\n- `userId` is a string. Each user must have their own unique string. The `userId` must have been added via `playlist.addUser(userId)` previous to calling this.\n- `newArray` is an array of song ids in the new order. You can remove songs, add songs, and reorder songs.\n\n### `playlist.reorderSong(userId, songId, newQueueLocationIndex)`\n\nThis is not the suggested way to reorder songs.\n\n- `userId` is a string. Each user must have their own unique string. The `userId` must have been added via `playlist.addUser(userId)` previous to calling this.\n- `songId` is compared to each `song.id` in the queue. This is the only place that `song.id` is assumed to exist.\n- `newQueueLocationIndex` is the number that the located song is relocated to.\n\n### `playlist.addUser(userId, userState)`\n\n- `userId` is a string. Each user must have their own unique string. The `userId` must have been added via `playlist.addUser(userId)` previous to calling this.\n- `userState` is an optional argument. It must come from `playlist.removeUser()`.\n\n### `var userState = playlist.removeUser(userId)`\n\n- **Returns** a `userState` object. This object can be passed into `playlist.addUser()` to start a new user with the same state that this user gave up. This could be used for changing a `userId` without losing their state, or saving a user's state for later use.\n\n# license\n\n[VOL](http://veryopenlicense.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartskydj%2Fplaylist-combinator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartskydj%2Fplaylist-combinator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartskydj%2Fplaylist-combinator/lists"}