Skip to content

Commit

Permalink
feat: Queue model to get tracks in queue
Browse files Browse the repository at this point in the history
  • Loading branch information
cdrani committed May 14, 2024
1 parent 3d87fda commit d0da40a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/models/queue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { currentData } from '../data/current'

export default class Queue {
constructor() {}

get addedToQueue() {
return document.querySelector('[aria-label="Next in queue"]')
}

get nextInQueue() {
return document.querySelector('[aria-label="Next up"]')
}

get blockedTracks() {
return currentData.blockedTracks
}
}
2 changes: 2 additions & 0 deletions src/observers/song-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import { timeToSeconds } from '../utils/time.js'
import { currentSongInfo } from '../utils/song.js'
import { highlightElement } from '../utils/higlight.js'

import Queue from '../models/queue.js'
import Dispatcher from '../events/dispatcher.js'

export default class SongTracker {
constructor() {
this._init = true
this._reverbSet = false
this._queue = new Queue()
this._currentSongState = null
this._video = spotifyVideo.element
this._dispatcher = new Dispatcher()
Expand Down

0 comments on commit d0da40a

Please sign in to comment.