-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create categories for plugins: meta provider, stream provider, lyrics…
… provider
- Loading branch information
Showing
12 changed files
with
92 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import * as MusicSourcePlugins from './MusicSources/'; | ||
import * as StreamProviderPlugins from './stream/'; | ||
|
||
export const config = { | ||
plugins: { | ||
musicSources: MusicSourcePlugins | ||
musicSources: StreamProviderPlugins | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import logger from 'electron-timber'; | ||
import lyrics from 'simple-get-lyrics'; | ||
|
||
import LyricsProvider from '../lyricsProvider'; | ||
|
||
class SimpleLyricsProvider extends LyricsProvider { | ||
constructor() { | ||
super(); | ||
this.name = 'Simple Lyrics Provider Plugin'; | ||
this.sourceName = 'Simple Lyrics Provider'; | ||
this.description = 'Simple lyrics provider plugin. Uses several sources with fallbacks.'; | ||
this.image = null; | ||
} | ||
|
||
search (artistName, trackName) { | ||
return lyrics.search(artistName, trackName) | ||
.then(result => result.lyrics).catch(function (err) { | ||
logger.log('error', err); | ||
}); | ||
} | ||
} | ||
|
||
export default SimpleLyricsProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import logger from 'electron-timber'; | ||
|
||
import Plugin from './plugin'; | ||
|
||
class LyricsProvider extends Plugin { | ||
constructor() { | ||
super(); | ||
this.name = 'Lyrics Provider Plugin'; | ||
this.sourceName = 'Generic Lyrics Provider'; | ||
this.description = 'A generic lyrics provider plugin. Should never be instantiated directly'; | ||
this.image = null; | ||
} | ||
|
||
search(artistName, trackName) { | ||
logger.error(`Search not implemented in plugin ${this.name}\n Query was: ${artistName}, ${trackName}`); | ||
} | ||
} | ||
|
||
export default LyricsProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import logger from 'electron-timber'; | ||
|
||
import Plugin from './plugin'; | ||
|
||
class MetaProvider extends Plugin { | ||
constructor() { | ||
super(); | ||
this.name = 'Meta Provider Plugin'; | ||
this.sourceName = 'Generic Metadata Provider'; | ||
this.description = 'A generic metadata provider plugin. Should never be instantiated directly'; | ||
this.image = null; | ||
} | ||
|
||
searchForArtists(query) { | ||
logger.error(`Search not implemented in plugin ${this.name}\n Query was: ${query}`); | ||
} | ||
|
||
searchForReleases(query) { | ||
logger.error(`Search not implemented in plugin ${this.name}\n Query was: ${query}`); | ||
} | ||
|
||
searchAll(query) { | ||
logger.error(`Search not implemented in plugin ${this.name}\n Query was: ${query}`); | ||
} | ||
} | ||
|
||
export default MetaProvider; |
4 changes: 2 additions & 2 deletions
4
app/plugins/MusicSources/JamendoPlugin.js → app/plugins/stream/JamendoPlugin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
app/plugins/MusicSources/LocalPlugin.js → app/plugins/stream/LocalPlugin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters