Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Commit

Permalink
add check for items existence
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkgroenen committed Dec 27, 2015
1 parent 05a6f8c commit 72e5d8e
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 141 deletions.
Binary file added dist/Mopidy-Mopify-1.5.11.tar.gz
Binary file not shown.
279 changes: 138 additions & 141 deletions mopify.sublime-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
{
"selected_items":
[
[
"local",
"localLists"
],
[
"tracklist",
"tracklistUrl"
Expand Down Expand Up @@ -275,10 +279,6 @@
"cur",
"cursor"
],
[
"local",
"localPromise"
],
[
"incl",
"include"
Expand Down Expand Up @@ -568,40 +568,49 @@
"/home/dirk/github/mopidy-mopify/src",
"/home/dirk/github/mopidy-mopify/src/app",
"/home/dirk/github/mopidy-mopify/src/app/services",
"/home/dirk/github/mopidy-mopify/src/vendor",
"/home/dirk/github/mopidy-mopify/src/vendor/angular-spotify",
"/home/dirk/github/mopidy-mopify/src/vendor/angular-spotify/src",
"/home/dirk/github/mopidy-mopify/mopidy_mopify",
"/home/dirk/github/mopidy-mopify/mopidy_mopify/services",
"/home/dirk/github/mopidy-mopify/mopidy_mopify/services/sync"
"/home/dirk/github/mopidy-mopify/src/vendor/angular-spotify/src"
],
"file_history":
[
"/home/dirk/github/mopidy-mopify/CHANGELOG.md",
"/home/dirk/github/mopidy-mopify/bower.json",
"/home/dirk/github/mopidy-mopify/package.json",
"/home/dirk/github/mopidy-mopify/src/app/search/search.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/app/search/search.controller.js",
"/home/dirk/github/mopidy-mopify/src/app/services/playlistmanager.service.js",
"/home/dirk/github/mopidy-mopify/README.md",
"/home/dirk/github/mopidy-mopify/CHANGELOG.nd",
"/home/dirk/github/mopidy-mopify/src/app/app.js",
"/home/dirk/github/mopidy-mopify/src/app/player/player.controller.js",
"/home/dirk/github/mopidy-mopify/src/app/player/controls/controls.controller.js",
"/home/dirk/github/mopidy-mopify/src/app/services/mopidy.service.js",
"/home/dirk/github/mopidy-mopify/src/app/player/controls/controls.right.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/app/music/tracklist/tracklist.controller.js",
"/home/dirk/github/mopidy-mopify/src/app/directives/track.directive.js",
"/home/dirk/github/mopidy-mopify/src/app/services/queuemanager.service.js",
"/home/dirk/github/mopidy-mopify/mopidy_mopify/services/queuemanager/core.py",
"/home/dirk/github/mopidy-mopify/mopidy_mopify/services/queuemanager/frontend.py",
"/home/dirk/github/mopidy-mopify/src/app/directives/track.directive.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/app/music/tracklist/tracklist.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/css/50-style.css",
"/home/dirk/github/mopidy-mopify/src/app/search/menu.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/index.html",
"/home/dirk/github/mopidy-mopify/src/app/services/autoupdate.service.js",
"/home/dirk/github/mopidy-mopify/src/app/services/sync.service.js",
"/home/dirk/github/mopidy-mopify/mopidy_mopify/__init__.py",
"/home/dirk/github/mopidy-mopify/mopidy_mopify/services/__init__.py",
"/home/dirk/github/mopidy-mopify/src/app/app.js",
"/home/dirk/github/mopidy-mopify/mopidy_mopify/services/sync/sync.py",
"/home/dirk/github/mopidy-mopify/mopidy_mopify/services/queuemanager/frontend.py",
"/home/dirk/github/mopidy-mopify/mopidy_mopify/services/queuemanager/core.py",
"/home/dirk/github/mopidy-mopify/src/app/services/spotify.service.js",
"/run/user/1000/gvfs/sftp:host=bitlabs.nl,user=bitlabs.nl/public/mopify/auth/spotify/callback/index.php",
"/run/user/1000/gvfs/sftp:host=bitlabs.nl,user=bitlabs.nl/public/mopify/auth/spotify/frame/index.php",
"/home/dirk/github/mopidy-mopify/package.json",
"/home/dirk/github/mopidy-mopify/src/app/search/search.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/app/search/menu.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/app/search/search.controller.js",
"/home/dirk/github/mopidy-mopify/src/app/directives/playlist.directive.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/app/directives/artist.directive.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/app/directives/album.directive.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/app/music/artist/artist.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/app/music/library/albums/albums.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/app/modals/playlistselect.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/css/50-style.css",
"/home/dirk/github/mopidy-mopify/src/app/player/player.tmpl.html",
"/home/dirk/github/mopidy-mopify/src/app/services/mopidy.service.js",
"/home/dirk/github/mopidy-mopify/src/app/player/player.controller.js",
"/home/dirk/github/mopidy-mopify/src/app/player/controls/controls.controller.js",
"/home/dirk/github/mopidy-mopify/src/app/directives/artist.directive.js",
"/home/dirk/github/mopidy-mopify/src/app/directives/album.directive.js",
"/home/dirk/github/mopidy-mopify/src/app/directives/playlist.directive.js",
Expand Down Expand Up @@ -691,20 +700,7 @@
"/run/user/1000/gvfs/sftp:host=bitlabs.nl,user=bitlabs.nl/public/pinterest/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Transport/Request.php",
"/run/user/1000/gvfs/sftp:host=bitlabs.nl,user=bitlabs.nl/public/pinterest/index.php",
"/run/user/1000/gvfs/sftp:host=bitlabs.nl,user=bitlabs.nl/public/pinterest/callback.php",
"/run/user/1000/gvfs/sftp:host=bitlabs.nl,user=bitlabs.nl/public/pinterest/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Utils/CurlBuilder.php",
"/run/user/1000/gvfs/sftp:host=bitlabs.nl,user=bitlabs.nl/public/pinterest/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Auth/PinterestOAuth.php",
"/home/dirk/github/Pinterest-API-PHP/CHANGELOG.md",
"/home/dirk/github/Pinterest-API-PHP/src/Pinterest/Auth/PinterestOAuth.php",
"/run/user/1000/gvfs/sftp:host=bitlabs.nl,user=bitlabs.nl/public/pinterest/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Transport/Response.php",
"/run/user/1000/gvfs/sftp:host=bitlabs.nl,user=bitlabs.nl/public/pinterest/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Exceptions/PinterestException.php",
"/run/user/1000/gvfs/sftp:host=bitlabs.nl,user=bitlabs.nl/public/opera/index.php",
"/run/user/1000/gvfs/sftp:host=domo,user=root/etc/pilight/tzdata.json",
"/home/dirk/github/jQuery-viewport-checker/dist/jquery.viewportchecker.min.js",
"/home/dirk/github/jQuery-viewport-checker/src/jquery.viewportchecker.js",
"/home/dirk/.cache/.fr-10hbQq/jQuery-viewport-checker-1.8.6/dist/jquery.viewportchecker.min.js",
"/home/dirk/.cache/.fr-ao6hFK/jQuery-viewport-checker-1.8.6/src/jquery.viewportchecker.js",
"/home/dirk/.cache/.fr-91J6Dy/jQuery-viewport-checker-1.8.6/src/jquery.viewportchecker.js",
"/home/dirk/.cache/.fr-MUFZ1w/jQuery-viewport-checker-1.8.6/dist/jquery.viewportchecker.min.js"
"/run/user/1000/gvfs/sftp:host=bitlabs.nl,user=bitlabs.nl/public/pinterest/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Utils/CurlBuilder.php"
],
"find":
{
Expand All @@ -722,6 +718,13 @@
"case_sensitive": false,
"find_history":
[
"playingtrack = ",
"focuss",
"performsearch()",
"refer",
".refer",
"focussearch",
"search",
"authorize",
"play:",
"tracklist",
Expand Down Expand Up @@ -842,13 +845,7 @@
"build/css",
".css",
"server",
"uglify",
"nghtml",
"ngHtml2Js",
"express",
"/dist",
"'),\n",
"remove"
"uglify"
],
"highlight": true,
"in_selection": false,
Expand Down Expand Up @@ -969,6 +966,106 @@
"last_filter": "",
"selected_items":
[
[
"searchtmpl",
"app/search/search.tmpl.html"
],
[
"playlistser",
"app/services/playlistmanager.service.js"
],
[
"serachcon",
"app/search/search.controller.js"
],
[
"app",
"app/app.js"
],
[
"mopidys",
"app/services/mopidy.service.js"
],
[
"playercon",
"app/player/controls/controls.controller.js"
],
[
"controlrighttm",
"app/player/controls/controls.right.tmpl.html"
],
[
"playercontr",
"app/player/player.controller.js"
],
[
"a",
"app/app.js"
],
[
"queue",
"app/services/queuemanager.service.js"
],
[
"trackdirectivetmpl",
"app/directives/track.directive.tmpl.html"
],
[
"tracktmpl",
"app/music/tracklist/tracklist.tmpl.html"
],
[
"trackdire",
"app/directives/track.directive.js"
],
[
"tracklistcon",
"app/music/tracklist/tracklist.controller.js"
],
[
"tracklisttmpl",
"app/music/tracklist/tracklist.tmpl.html"
],
[
"mopidyservice",
"app/services/mopidy.service.js"
],
[
"styles",
"css/50-style.css"
],
[
"stylecs",
"css/50-style.css"
],
[
"index",
"index.html"
],
[
"searchmenu",
"app/search/menu.tmpl.html"
],
[
"searchcontr",
"app/search/search.controller.js"
],
[
"mopidyser",
"app/services/mopidy.service.js"
],
[
"syncs",
"app/services/sync.service.js"
],
[
"auto",
"app/services/autoupdate.service.js"
],
[
"queuema",
"app/services/queuemanager.service.js"
],
[
"mopifyini",
"mopidy_mopify/services/__init__.py"
Expand All @@ -985,10 +1082,6 @@
"spotify",
"src/app/services/spotify.service.js"
],
[
"app",
"src/app/app.js"
],
[
"spotifys",
"src/app/services/spotify.service.js"
Expand All @@ -1001,10 +1094,6 @@
"menutmpl",
"src/app/search/menu.tmpl.html"
],
[
"searchtmpl",
"src/app/search/search.tmpl.html"
],
[
"albumdiretm",
"src/app/directives/album.directive.tmpl.html"
Expand Down Expand Up @@ -1049,10 +1138,6 @@
"playercontro",
"src/app/player/player.controller.js"
],
[
"mopidyser",
"src/app/services/mopidy.service.js"
],
[
"artistditmpl",
"src/app/directives/artist.directive.tmpl.html"
Expand Down Expand Up @@ -1273,10 +1358,6 @@
"calendarcontro",
"src/app/components/scheduler/calendar/calendar.controller.js"
],
[
"trackdire",
"src/app/components/music/lists/tracklist/track/track.directive.js"
],
[
"contextmenudire",
"src/app/components/contextmenu/contextmenu.directive.js"
Expand All @@ -1285,10 +1366,6 @@
"contxtmtmpl",
"src/app/components/music/collection/contextmenu.tmpl.html"
],
[
"tracktmpl",
"src/app/components/music/lists/tracklist/track/track.tmpl.html"
],
[
"dayblockdi",
"src/app/components/scheduler/calendar/dayblock/dayblock.directive.js"
Expand Down Expand Up @@ -1400,86 +1477,6 @@
[
"schedu",
"src/app/components/scheduler/scheduler.tmpl.html"
],
[
"trackscs",
"src/app/components/music/lists/tracklist/track/track.scss"
],
[
"songmode",
"src/app/models/song.model.js"
],
[
"playerscs",
"src/app/components/music/player/player.scss"
],
[
"playerser",
"src/app/components/music/player/player.service.js"
],
[
"traklistdire",
"src/app/components/music/lists/tracklist/tracklist.directive.js"
],
[
"tiledire",
"src/app/components/music/grids/albumgrid/album/tile.directive.js"
],
[
"queuetmpl",
"src/app/components/music/player/queue/queue.tmpl.html"
],
[
"tracklistdire",
"src/app/components/music/lists/tracklist/tracklist.directive.js"
],
[
"tracklisttmpl",
"src/app/components/music/lists/tracklist/tracklist.tmpl.html"
],
[
"inexrun",
"src/app/index.run.js"
],
[
"indexmod",
"src/app/index.module.js"
],
[
"indexjs",
"src/app/interceptors/index.js"
],
[
"indexrun",
"src/app/index.run.js"
],
[
"playercon",
"src/app/components/music/player/player.controller.js"
],
[
"playerobj",
"src/app/components/music/player/audio/audio.object.js"
],
[
"audioobj",
"src/app/components/music/player/audio/audio.object.js"
],
[
"collecitonapi",
"src/app/components/music/collection/collection.api.js"
],
[
"favapi",
"src/app/components/music/favorites/favorites.api.js"
],
[
"favseri",
"src/app/components/music/favorites/favorites.service.js"
],
[
"collectionser",
"src/app/components/music/collection/collection.service.js"
]
],
"width": 0.0
Expand Down
5 changes: 5 additions & 0 deletions src/app/search/search.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ angular.module('mopify.search', [
}).then(function(data){
// Perform local search and put at beginning of playlist array
var localLists = PlaylistManager.search($scope.query);

if(data.playlists === undefined){
data.playlists = {items: []};
}

data.playlists.items = localLists.concat(data.playlists.items);

$scope.results.artists = data.artists;
Expand Down

0 comments on commit 72e5d8e

Please sign in to comment.