From 018e88050868cf7149da5c055f3f5570ec123814 Mon Sep 17 00:00:00 2001 From: nelsonlaquet Date: Sat, 31 Aug 2013 21:28:45 -0500 Subject: [PATCH] performance for when not logged in simple style updates --- app/controllers/Api/Web/PlaylistsController.php | 2 +- app/models/Entities/Album.php | 2 +- app/models/Entities/Playlist.php | 2 +- app/models/Entities/Track.php | 2 +- app/views/shared/_layout.blade.php | 2 +- public/styles/player.less | 7 ++++++- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/controllers/Api/Web/PlaylistsController.php b/app/controllers/Api/Web/PlaylistsController.php index 99c24034..5134cac6 100644 --- a/app/controllers/Api/Web/PlaylistsController.php +++ b/app/controllers/Api/Web/PlaylistsController.php @@ -39,7 +39,7 @@ $page = Input::get('page'); $query = Playlist::summary() - ->with('user', 'user.avatar', 'tracks', 'tracks.cover') + ->with('user', 'user.avatar', 'tracks', 'tracks.cover', 'tracks.user', 'tracks.album', 'tracks.album.user') ->userDetails() ->orderBy('created_at', 'desc') ->where('track_count', '>', 0) diff --git a/app/models/Entities/Album.php b/app/models/Entities/Album.php index c9fdc09c..65ddbbd9 100644 --- a/app/models/Entities/Album.php +++ b/app/models/Entities/Album.php @@ -99,7 +99,7 @@ 'is_favourited' => false ]; - if ($album->users->count()) { + if (Auth::check() && $album->users->count()) { $userRow = $album->users[0]; $userData = [ 'stats' => [ diff --git a/app/models/Entities/Playlist.php b/app/models/Entities/Playlist.php index 46be51b2..b5350cef 100644 --- a/app/models/Entities/Playlist.php +++ b/app/models/Entities/Playlist.php @@ -71,7 +71,7 @@ 'is_favourited' => false ]; - if ($playlist->users->count()) { + if (Auth::check() && $playlist->users->count()) { $userRow = $playlist->users[0]; $userData = [ 'stats' => [ diff --git a/app/models/Entities/Track.php b/app/models/Entities/Track.php index 6c845f86..203b8bd7 100644 --- a/app/models/Entities/Track.php +++ b/app/models/Entities/Track.php @@ -136,7 +136,7 @@ 'is_favourited' => false ]; - if ($track->users->count()) { + if (Auth::check() && $track->users->count()) { $userRow = $track->users[0]; $userData = [ 'stats' => [ diff --git a/app/views/shared/_layout.blade.php b/app/views/shared/_layout.blade.php index d56ce336..b8d33db6 100644 --- a/app/views/shared/_layout.blade.php +++ b/app/views/shared/_layout.blade.php @@ -10,7 +10,7 @@ @yield('styles') - + @yield('content') @yield('scripts') diff --git a/public/styles/player.less b/public/styles/player.less index 9302a342..c505c742 100644 --- a/public/styles/player.less +++ b/public/styles/player.less @@ -1,8 +1,13 @@ @import-once 'variables'; @import-once 'mixins'; +body.is-logged { + .track-player { + margin-right: 75px; + } +} + .track-player { - margin-right: 75px; padding: 10px; .image {