diff --git a/resources/assets/scripts/app/app.coffee b/resources/assets/scripts/app/app.coffee
index dc5beecb..42c4324d 100644
--- a/resources/assets/scripts/app/app.coffee
+++ b/resources/assets/scripts/app/app.coffee
@@ -70,10 +70,10 @@ if window.pfm.environment == 'production'
]
ponyfm.run [
- '$rootScope',
- ($rootScope) ->
+ '$rootScope', 'meta',
+ ($rootScope, meta) ->
$rootScope.$on '$stateChangeStart', (event, toState, toParams, fromState, fromParams) ->
- $rootScope.description = ''
+ meta.reset()
]
ponyfm.config [
diff --git a/resources/assets/scripts/app/controllers/album.coffee b/resources/assets/scripts/app/controllers/album.coffee
index 122ef367..aaa92235 100644
--- a/resources/assets/scripts/app/controllers/album.coffee
+++ b/resources/assets/scripts/app/controllers/album.coffee
@@ -21,14 +21,15 @@ window.pfm.preloaders['album'] = [
]
module.exports = angular.module('ponyfm').controller "album", [
- '$scope', '$rootScope', 'albums', '$state', 'playlists', 'auth', '$dialog', 'download-cached', '$window', '$timeout'
- ($scope, $rootScope, albums, $state, playlists, auth, $dialog, cachedAlbum, $window, $timeout) ->
+ '$scope', 'meta', 'albums', '$state', 'playlists', 'auth', '$dialog', 'download-cached', '$window', '$timeout'
+ ($scope, meta, albums, $state, playlists, auth, $dialog, cachedAlbum, $window, $timeout) ->
album = null
albums.fetch($state.params.id).done (albumResponse) ->
$scope.album = albumResponse.album
album = albumResponse.album
- $rootScope.description = "Listen to #{album.title}, the album by #{album.user.name}, and more on the largest pony music site."
+ meta.setTitle("#{album.title} | #{album.user.name}")
+ meta.setDescription("Listen to #{album.title}, the album by #{album.user.name}, and more on the largest pony music site.")
$scope.playlists = []
diff --git a/resources/assets/scripts/app/controllers/dashboard.coffee b/resources/assets/scripts/app/controllers/dashboard.coffee
index e4f8246c..2ed5567c 100644
--- a/resources/assets/scripts/app/controllers/dashboard.coffee
+++ b/resources/assets/scripts/app/controllers/dashboard.coffee
@@ -22,6 +22,7 @@ window.pfm.preloaders['dashboard'] = [
module.exports = angular.module('ponyfm').controller "dashboard", [
'$scope', 'dashboard', 'auth', '$http'
($scope, dashboard, auth, $http) ->
+
$scope.recentTracks = null
$scope.popularTracks = null
diff --git a/resources/assets/scripts/app/controllers/home.coffee b/resources/assets/scripts/app/controllers/home.coffee
index 31367d43..c375384f 100644
--- a/resources/assets/scripts/app/controllers/home.coffee
+++ b/resources/assets/scripts/app/controllers/home.coffee
@@ -20,8 +20,10 @@ window.pfm.preloaders['home'] = [
]
module.exports = angular.module('ponyfm').controller "home", [
- '$scope', 'dashboard'
- ($scope, dashboard) ->
+ '$scope', 'meta', 'dashboard'
+ ($scope, meta, dashboard) ->
+ meta.reset()
+
$scope.recentTracks = null
$scope.popularTracks = null
diff --git a/resources/assets/scripts/app/controllers/playlist.coffee b/resources/assets/scripts/app/controllers/playlist.coffee
index d14cc496..1d1c1c0a 100644
--- a/resources/assets/scripts/app/controllers/playlist.coffee
+++ b/resources/assets/scripts/app/controllers/playlist.coffee
@@ -21,14 +21,15 @@ window.pfm.preloaders['playlist'] = [
]
module.exports = angular.module('ponyfm').controller 'playlist', [
- '$scope', '$rootScope', '$state', 'playlists', '$dialog', 'download-cached', '$window', '$timeout'
- ($scope, $rootScope, $state, playlists, $dialog, cachedPlaylist, $window, $timeout) ->
+ '$scope', 'meta', '$state', 'playlists', '$dialog', 'download-cached', '$window', '$timeout'
+ ($scope, meta, $state, playlists, $dialog, cachedPlaylist, $window, $timeout) ->
playlist = null
playlists.fetch($state.params.id).done (playlistResponse) ->
$scope.playlist = playlistResponse
playlist = playlistResponse
- $rootScope.description = "Listen to #{playlist.title} by #{playlist.user.name} on the largest pony music site"
+ meta.setTitle("#{playlist.title} | #{playlist.user.name}")
+ meta.setDescription("Listen to \"#{playlist.title}\", a playlist by #{playlist.user.name}, on the largest pony music site.")
$scope.share = () ->
dialog = $dialog.dialog
diff --git a/resources/assets/scripts/app/controllers/track.coffee b/resources/assets/scripts/app/controllers/track.coffee
index 8344a6a7..8092a690 100644
--- a/resources/assets/scripts/app/controllers/track.coffee
+++ b/resources/assets/scripts/app/controllers/track.coffee
@@ -15,15 +15,16 @@
# along with this program. If not, see