mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 13:07:59 +01:00
Moved all database models into their own namespace.
This commit is contained in:
parent
79a0129e6d
commit
5ff04ff08d
84 changed files with 242 additions and 195 deletions
|
@ -20,8 +20,8 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Playlist;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Playlist;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Album;
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\Models\Album;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Album;
|
||||
use Poniverse\Ponyfm\Comment;
|
||||
use Poniverse\Ponyfm\Playlist;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\Album;
|
||||
use Poniverse\Ponyfm\Models\Comment;
|
||||
use Poniverse\Ponyfm\Models\Playlist;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Playlist;
|
||||
use Poniverse\Ponyfm\Models\Playlist;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Album;
|
||||
use Poniverse\Ponyfm\Models\Album;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class DeleteAlbumCommand extends CommandBase
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace Poniverse\Ponyfm\Commands;
|
|||
|
||||
use Gate;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Poniverse\Ponyfm\Genre;
|
||||
use Poniverse\Ponyfm\Models\Genre;
|
||||
use Poniverse\Ponyfm\Jobs\DeleteGenre;
|
||||
use Validator;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Playlist;
|
||||
use Poniverse\Ponyfm\Models\Playlist;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class DeletePlaylistCommand extends CommandBase
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
|
||||
class DeleteTrackCommand extends CommandBase
|
||||
{
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Album;
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\Models\Album;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\PinnedPlaylist;
|
||||
use Poniverse\Ponyfm\Playlist;
|
||||
use Poniverse\Ponyfm\Models\PinnedPlaylist;
|
||||
use Poniverse\Ponyfm\Models\Playlist;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Album;
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\TrackType;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\Album;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\TrackType;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
use Auth;
|
||||
use DB;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace Poniverse\Ponyfm\Commands;
|
|||
|
||||
use Gate;
|
||||
use Illuminate\Support\Str;
|
||||
use Poniverse\Ponyfm\Genre;
|
||||
use Poniverse\Ponyfm\Models\Genre;
|
||||
use Validator;
|
||||
|
||||
class RenameGenreCommand extends CommandBase
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Favourite;
|
||||
use Poniverse\Ponyfm\ResourceUser;
|
||||
use Poniverse\Ponyfm\Models\Favourite;
|
||||
use Poniverse\Ponyfm\Models\ResourceUser;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Follower;
|
||||
use Poniverse\Ponyfm\ResourceUser;
|
||||
use Poniverse\Ponyfm\Models\Follower;
|
||||
use Poniverse\Ponyfm\Models\ResourceUser;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class ToggleFollowingCommand extends CommandBase
|
||||
|
|
|
@ -25,18 +25,18 @@ use Config;
|
|||
use getID3;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Input;
|
||||
use Poniverse\Ponyfm\Album;
|
||||
use Poniverse\Ponyfm\Models\Album;
|
||||
use Poniverse\Ponyfm\Exceptions\InvalidEncodeOptionsException;
|
||||
use Poniverse\Ponyfm\Genre;
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\Models\Genre;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Poniverse\Ponyfm\Jobs\EncodeTrackFile;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\TrackFile;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\TrackFile;
|
||||
use AudioCache;
|
||||
use File;
|
||||
use Illuminate\Support\Str;
|
||||
use Poniverse\Ponyfm\TrackType;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\TrackType;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Console\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\ShowSong;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\TrackType;
|
||||
use Poniverse\Ponyfm\Models\ShowSong;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\TrackType;
|
||||
use DB;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Str;
|
||||
|
|
|
@ -24,7 +24,7 @@ use Carbon\Carbon;
|
|||
use File;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Poniverse\Ponyfm\TrackFile;
|
||||
use Poniverse\Ponyfm\Models\TrackFile;
|
||||
|
||||
class ClearTrackCache extends Command
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
namespace Poniverse\Ponyfm\Console\Commands;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Poniverse\Ponyfm\ResourceLogItem;
|
||||
use Poniverse\Ponyfm\Models\ResourceLogItem;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class FixYearZeroLogs extends Command
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Console\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Album;
|
||||
use Poniverse\Ponyfm\Models\Album;
|
||||
use Poniverse\Ponyfm\Commands\UploadTrackCommand;
|
||||
use Poniverse\Ponyfm\Genre;
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\Genre;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Config;
|
||||
|
|
|
@ -24,17 +24,17 @@ use Carbon\Carbon;
|
|||
use DB;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Collection;
|
||||
use Poniverse\Ponyfm\Album;
|
||||
use Poniverse\Ponyfm\Comment;
|
||||
use Poniverse\Ponyfm\Favourite;
|
||||
use Poniverse\Ponyfm\Follower;
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\PinnedPlaylist;
|
||||
use Poniverse\Ponyfm\Playlist;
|
||||
use Poniverse\Ponyfm\ResourceLogItem;
|
||||
use Poniverse\Ponyfm\ResourceUser;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\Album;
|
||||
use Poniverse\Ponyfm\Models\Comment;
|
||||
use Poniverse\Ponyfm\Models\Favourite;
|
||||
use Poniverse\Ponyfm\Models\Follower;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Poniverse\Ponyfm\Models\PinnedPlaylist;
|
||||
use Poniverse\Ponyfm\Models\Playlist;
|
||||
use Poniverse\Ponyfm\Models\ResourceLogItem;
|
||||
use Poniverse\Ponyfm\Models\ResourceUser;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
|
||||
class MergeDuplicateAccounts extends Command
|
||||
{
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Console\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\ResourceLogItem;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Poniverse\Ponyfm\Models\ResourceLogItem;
|
||||
use DB;
|
||||
use Exception;
|
||||
use Illuminate\Console\Command;
|
||||
|
|
|
@ -23,8 +23,8 @@ namespace Poniverse\Ponyfm\Console\Commands;
|
|||
use Carbon\Carbon;
|
||||
use DB;
|
||||
use Illuminate\Console\Command;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\TrackType;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\TrackType;
|
||||
|
||||
class PublishUnclassifiedMlpmaTracks extends Command
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
namespace Poniverse\Ponyfm\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
|
||||
class RebuildArtists extends Command
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace Poniverse\Ponyfm\Console\Commands;
|
|||
|
||||
use File;
|
||||
use Illuminate\Console\Command;
|
||||
use Poniverse\Ponyfm\TrackFile;
|
||||
use Poniverse\Ponyfm\Models\TrackFile;
|
||||
|
||||
class RebuildFilesizes extends Command
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Console\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class RebuildTags extends Command
|
||||
|
|
|
@ -24,8 +24,8 @@ use File;
|
|||
use Illuminate\Console\Command;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Poniverse\Ponyfm\Jobs\EncodeTrackFile;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\TrackFile;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\TrackFile;
|
||||
|
||||
class RebuildTrackCache extends Command
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Console\Commands;
|
||||
|
||||
use Poniverse\Ponyfm\ResourceLogItem;
|
||||
use Poniverse\Ponyfm\Models\ResourceLogItem;
|
||||
use DB;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
|
|
|
@ -22,9 +22,9 @@ namespace Poniverse\Ponyfm\Http\Controllers;
|
|||
|
||||
use Poniverse\Ponyfm\AlbumDownloader;
|
||||
use App;
|
||||
use Poniverse\Ponyfm\Album;
|
||||
use Poniverse\Ponyfm\Models\Album;
|
||||
use Poniverse\Ponyfm\ResourceLogItem;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use View;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
namespace Poniverse\Ponyfm\Http\Controllers\Api\Mobile;
|
||||
|
||||
use Poniverse\Ponyfm\Http\Controllers\Controller;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Response;
|
||||
|
||||
class TracksController extends Controller
|
||||
|
|
|
@ -22,8 +22,8 @@ namespace Poniverse\Ponyfm\Http\Controllers\Api\V1;
|
|||
|
||||
use Poniverse\Ponyfm\Commands\UploadTrackCommand;
|
||||
use Poniverse\Ponyfm\Http\Controllers\ApiControllerBase;
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Response;
|
||||
|
||||
class TracksController extends ApiControllerBase
|
||||
|
|
|
@ -22,18 +22,18 @@ namespace Poniverse\Ponyfm\Http\Controllers\Api\Web;
|
|||
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Poniverse\Ponyfm\Album;
|
||||
use Poniverse\Ponyfm\Models\Album;
|
||||
use Poniverse\Ponyfm\Commands\CreateAlbumCommand;
|
||||
use Poniverse\Ponyfm\Commands\DeleteAlbumCommand;
|
||||
use Poniverse\Ponyfm\Commands\EditAlbumCommand;
|
||||
use Poniverse\Ponyfm\Http\Controllers\ApiControllerBase;
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Poniverse\Ponyfm\Jobs\EncodeTrackFile;
|
||||
use Poniverse\Ponyfm\ResourceLogItem;
|
||||
use Poniverse\Ponyfm\Models\ResourceLogItem;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
|
||||
class AlbumsController extends ApiControllerBase
|
||||
{
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
namespace Poniverse\Ponyfm\Http\Controllers\Api\Web;
|
||||
|
||||
use Poniverse\Ponyfm\Album;
|
||||
use Poniverse\Ponyfm\Comment;
|
||||
use Poniverse\Ponyfm\Favourite;
|
||||
use Poniverse\Ponyfm\Models\Comment;
|
||||
use Poniverse\Ponyfm\Models\Favourite;
|
||||
use Poniverse\Ponyfm\Http\Controllers\ApiControllerBase;
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
use Cover;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
|
@ -59,10 +59,10 @@ class ArtistsController extends ApiControllerBase
|
|||
$albums = [];
|
||||
|
||||
foreach ($favs as $fav) {
|
||||
if ($fav->type == 'Poniverse\Ponyfm\Track') {
|
||||
if ($fav->type == 'Poniverse\Ponyfm\Models\Track') {
|
||||
$tracks[] = Track::mapPublicTrackSummary($fav->track);
|
||||
} else {
|
||||
if ($fav->type == 'Poniverse\Ponyfm\Album') {
|
||||
if ($fav->type == 'Poniverse\Ponyfm\Models\Album') {
|
||||
$albums[] = Album::mapPublicAlbumSummary($fav->album);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace Poniverse\Ponyfm\Http\Controllers\Api\Web;
|
|||
|
||||
use App;
|
||||
use Poniverse\Ponyfm\Commands\CreateCommentCommand;
|
||||
use Poniverse\Ponyfm\Comment;
|
||||
use Poniverse\Ponyfm\Models\Comment;
|
||||
use Poniverse\Ponyfm\Http\Controllers\ApiControllerBase;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
namespace Poniverse\Ponyfm\Http\Controllers\Api\Web;
|
||||
|
||||
use Poniverse\Ponyfm\Http\Controllers\ApiControllerBase;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Http\Controllers\Api\Web;
|
||||
|
||||
use Poniverse\Ponyfm\Album;
|
||||
use Poniverse\Ponyfm\Models\Album;
|
||||
use Poniverse\Ponyfm\Commands\ToggleFavouriteCommand;
|
||||
use Poniverse\Ponyfm\Favourite;
|
||||
use Poniverse\Ponyfm\Models\Favourite;
|
||||
use Poniverse\Ponyfm\Http\Controllers\ApiControllerBase;
|
||||
use Poniverse\Ponyfm\Playlist;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Playlist;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Poniverse\Ponyfm\Http\Controllers\Api\Web;
|
|||
use Input;
|
||||
use Poniverse\Ponyfm\Commands\DeleteGenreCommand;
|
||||
use Poniverse\Ponyfm\Commands\RenameGenreCommand;
|
||||
use Poniverse\Ponyfm\Genre;
|
||||
use Poniverse\Ponyfm\Models\Genre;
|
||||
use Poniverse\Ponyfm\Http\Controllers\ApiControllerBase;
|
||||
use Response;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
namespace Poniverse\Ponyfm\Http\Controllers\Api\Web;
|
||||
|
||||
use Poniverse\Ponyfm\Http\Controllers\ApiControllerBase;
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Cover;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
|
||||
|
|
|
@ -26,13 +26,13 @@ use Poniverse\Ponyfm\Commands\CreatePlaylistCommand;
|
|||
use Poniverse\Ponyfm\Commands\DeletePlaylistCommand;
|
||||
use Poniverse\Ponyfm\Commands\EditPlaylistCommand;
|
||||
use Poniverse\Ponyfm\Http\Controllers\ApiControllerBase;
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\Playlist;
|
||||
use Poniverse\Ponyfm\ResourceLogItem;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Poniverse\Ponyfm\Models\Playlist;
|
||||
use Poniverse\Ponyfm\Models\ResourceLogItem;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
|
||||
class PlaylistsController extends ApiControllerBase
|
||||
{
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Http\Controllers\Api\Web;
|
||||
|
||||
use Poniverse\Ponyfm\Genre;
|
||||
use Poniverse\Ponyfm\Models\Genre;
|
||||
use Poniverse\Ponyfm\Http\Controllers\ApiControllerBase;
|
||||
use Poniverse\Ponyfm\License;
|
||||
use Poniverse\Ponyfm\ShowSong;
|
||||
use Poniverse\Ponyfm\TrackType;
|
||||
use Poniverse\Ponyfm\Models\License;
|
||||
use Poniverse\Ponyfm\Models\ShowSong;
|
||||
use Poniverse\Ponyfm\Models\TrackType;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class TaxonomiesController extends ApiControllerBase
|
||||
|
|
|
@ -29,8 +29,8 @@ use Poniverse\Ponyfm\Commands\UploadTrackCommand;
|
|||
use Poniverse\Ponyfm\Http\Controllers\ApiControllerBase;
|
||||
use Poniverse\Ponyfm\Jobs\EncodeTrackFile;
|
||||
use Poniverse\Ponyfm\ResourceLogItem;
|
||||
use Poniverse\Ponyfm\TrackFile;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\TrackFile;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Response;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
namespace Poniverse\Ponyfm\Http\Controllers;
|
||||
|
||||
use App;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
use View;
|
||||
use Redirect;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Http\Controllers;
|
||||
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
use Auth;
|
||||
use Config;
|
||||
use DB;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Http\Controllers;
|
||||
|
||||
use Poniverse\Ponyfm\Image;
|
||||
use Poniverse\Ponyfm\Models\Image;
|
||||
use Config;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
namespace Poniverse\Ponyfm\Http\Controllers;
|
||||
|
||||
use App;
|
||||
use Poniverse\Ponyfm\Playlist;
|
||||
use Poniverse\Ponyfm\ResourceLogItem;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Playlist;
|
||||
use Poniverse\Ponyfm\Models\ResourceLogItem;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\PlaylistDownloader;
|
||||
use Auth;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Http\Controllers;
|
||||
|
||||
use Poniverse\Ponyfm\ResourceLogItem;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\TrackFile;
|
||||
use Poniverse\Ponyfm\Models\ResourceLogItem;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\TrackFile;
|
||||
use Auth;
|
||||
use Config;
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
|
|
@ -24,7 +24,7 @@ use Auth;
|
|||
use Closure;
|
||||
use GuzzleHttp;
|
||||
use Poniverse;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||
|
||||
class AuthenticateOAuth
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
namespace Poniverse\Ponyfm\Jobs;
|
||||
|
||||
use Auth;
|
||||
use Poniverse\Ponyfm\Genre;
|
||||
use Poniverse\Ponyfm\Models\Genre;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Bus\SelfHandling;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use SerializesModels;
|
||||
|
||||
class DeleteGenre extends Job implements SelfHandling, ShouldQueue
|
||||
|
|
|
@ -33,8 +33,8 @@ use Illuminate\Queue\SerializesModels;
|
|||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Bus\SelfHandling;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\TrackFile;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\TrackFile;
|
||||
use Symfony\Component\Process\Exception\ProcessFailedException;
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
|
|
|
@ -40,6 +40,6 @@ class PFMAuth extends EloquentUserProvider
|
|||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct(new NullHasher(), 'Poniverse\Ponyfm\User');
|
||||
parent::__construct(new NullHasher(), 'Poniverse\Ponyfm\Models\User');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Exception;
|
||||
use Helpers;
|
||||
|
@ -62,27 +62,27 @@ class Album extends Model
|
|||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\User');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\User');
|
||||
}
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\ResourceUser');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\ResourceUser');
|
||||
}
|
||||
|
||||
public function favourites()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\Favourite');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\Favourite');
|
||||
}
|
||||
|
||||
public function cover()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Image');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\Image');
|
||||
}
|
||||
|
||||
public function tracks()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\Track')->orderBy('track_number', 'asc');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\Track')->orderBy('track_number', 'asc');
|
||||
}
|
||||
|
||||
public function trackFiles() {
|
||||
|
@ -91,7 +91,7 @@ class Album extends Model
|
|||
|
||||
public function comments()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\Comment')->orderBy('created_at', 'desc');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\Comment')->orderBy('created_at', 'desc');
|
||||
}
|
||||
|
||||
public static function mapPublicAlbumShow(Album $album)
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
@ -34,27 +34,27 @@ class Comment extends Model
|
|||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\User');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\User');
|
||||
}
|
||||
|
||||
public function track()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Track');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\Track');
|
||||
}
|
||||
|
||||
public function album()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Album');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\Album');
|
||||
}
|
||||
|
||||
public function playlist()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Playlist');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\Playlist');
|
||||
}
|
||||
|
||||
public function profile()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\User', 'profile_id');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\User', 'profile_id');
|
||||
}
|
||||
|
||||
public static function mapPublic($comment)
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
|
@ -35,22 +35,22 @@ class Favourite extends Model
|
|||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\User');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\User');
|
||||
}
|
||||
|
||||
public function track()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Track');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\Track');
|
||||
}
|
||||
|
||||
public function album()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Album');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\Album');
|
||||
}
|
||||
|
||||
public function playlist()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Playlist');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\Playlist');
|
||||
}
|
||||
|
||||
/**
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use DB;
|
||||
use Illuminate\Database\Eloquent\Relations\Relation;
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use External;
|
||||
use Illuminate\Database\Eloquent\Model;
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
|
@ -28,11 +28,11 @@ class PinnedPlaylist extends Model
|
|||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\User');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\User');
|
||||
}
|
||||
|
||||
public function playlist()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Playlist');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\Playlist');
|
||||
}
|
||||
}
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Helpers;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
@ -152,7 +152,7 @@ class Playlist extends Model
|
|||
public function tracks()
|
||||
{
|
||||
return $this
|
||||
->belongsToMany('Poniverse\Ponyfm\Track')
|
||||
->belongsToMany('Poniverse\Ponyfm\Models\Track')
|
||||
->withPivot('position')
|
||||
->withTimestamps()
|
||||
->orderBy('position', 'asc');
|
||||
|
@ -166,22 +166,22 @@ class Playlist extends Model
|
|||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\ResourceUser');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\ResourceUser');
|
||||
}
|
||||
|
||||
public function comments()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\Comment')->orderBy('created_at', 'desc');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\Comment')->orderBy('created_at', 'desc');
|
||||
}
|
||||
|
||||
public function pins()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\PinnedPlaylist');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\PinnedPlaylist');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\User');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\User');
|
||||
}
|
||||
|
||||
public function hasPinFor($userId)
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Carbon\Carbon;
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Auth;
|
||||
use Cache;
|
||||
|
@ -411,52 +411,52 @@ class Track extends Model
|
|||
|
||||
public function genre()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Genre');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\Genre');
|
||||
}
|
||||
|
||||
public function trackType()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\TrackType', 'track_type_id');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\TrackType', 'track_type_id');
|
||||
}
|
||||
|
||||
public function comments()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\Comment')->orderBy('created_at', 'desc');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\Comment')->orderBy('created_at', 'desc');
|
||||
}
|
||||
|
||||
public function favourites()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\Favourite');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\Favourite');
|
||||
}
|
||||
|
||||
public function cover()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Image');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\Image');
|
||||
}
|
||||
|
||||
public function showSongs()
|
||||
{
|
||||
return $this->belongsToMany('Poniverse\Ponyfm\ShowSong');
|
||||
return $this->belongsToMany('Poniverse\Ponyfm\Models\ShowSong');
|
||||
}
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\ResourceUser');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\ResourceUser');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\User');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\User');
|
||||
}
|
||||
|
||||
public function album()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Album');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\Album');
|
||||
}
|
||||
|
||||
public function trackFiles()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\TrackFile');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\TrackFile');
|
||||
}
|
||||
|
||||
public function getYearAttribute()
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Config;
|
||||
use Helpers;
|
||||
|
@ -36,7 +36,7 @@ class TrackFile extends Model
|
|||
|
||||
public function track()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Track')->withTrashed();
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\Track')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Poniverse\Ponyfm;
|
||||
namespace Poniverse\Ponyfm\Models;
|
||||
|
||||
use Gravatar;
|
||||
use Illuminate\Auth\Authenticatable;
|
||||
|
@ -91,12 +91,12 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
|
||||
public function avatar()
|
||||
{
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Image');
|
||||
return $this->belongsTo('Poniverse\Ponyfm\Models\Image');
|
||||
}
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\ResourceUser', 'artist_id');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\ResourceUser', 'artist_id');
|
||||
}
|
||||
|
||||
public function roles()
|
||||
|
@ -106,12 +106,12 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
|
||||
public function comments()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\Comment', 'profile_id')->orderBy('created_at', 'desc');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\Comment', 'profile_id')->orderBy('created_at', 'desc');
|
||||
}
|
||||
|
||||
public function tracks()
|
||||
{
|
||||
return $this->hasMany('Poniverse\Ponyfm\Track', 'user_id');
|
||||
return $this->hasMany('Poniverse\Ponyfm\Models\Track', 'user_id');
|
||||
}
|
||||
|
||||
public function getIsArchivedAttribute()
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Policies;
|
||||
|
||||
use Poniverse\Ponyfm\Genre;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\Genre;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
|
||||
class GenrePolicy
|
||||
{
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Policies;
|
||||
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
|
||||
class TrackPolicy
|
||||
{
|
||||
|
|
|
@ -22,11 +22,11 @@ namespace Poniverse\Ponyfm\Providers;
|
|||
|
||||
use Illuminate\Contracts\Auth\Access\Gate as GateContract;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Poniverse\Ponyfm\Genre;
|
||||
use Poniverse\Ponyfm\Models\Genre;
|
||||
use Poniverse\Ponyfm\Policies\GenrePolicy;
|
||||
use Poniverse\Ponyfm\Policies\TrackPolicy;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@ use File;
|
|||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Relations\Relation;
|
||||
use Poniverse\Ponyfm\Jobs\EncodeTrackFile;
|
||||
use Poniverse\Ponyfm\TrackFile;
|
||||
use Poniverse\Ponyfm\Models\TrackFile;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -28,7 +28,7 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'model' => Poniverse\Ponyfm\User::class,
|
||||
'model' => Poniverse\Ponyfm\Models\User::class,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
@ -30,7 +30,7 @@ return [
|
|||
],
|
||||
|
||||
'stripe' => [
|
||||
'model' => Poniverse\Ponyfm\User::class,
|
||||
'model' => Poniverse\Ponyfm\Models\User::class,
|
||||
'key' => '',
|
||||
'secret' => '',
|
||||
],
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
|
|
||||
*/
|
||||
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
|
||||
$factory->define(Poniverse\Ponyfm\User::class, function (\Faker\Generator $faker) {
|
||||
$factory->define(Poniverse\Ponyfm\Models\User::class, function (\Faker\Generator $faker) {
|
||||
return [
|
||||
'username' => $faker->userName,
|
||||
'display_name' => $faker->userName,
|
||||
|
@ -45,14 +45,14 @@ $factory->define(Poniverse\Ponyfm\User::class, function (\Faker\Generator $faker
|
|||
];
|
||||
});
|
||||
|
||||
$factory->define(\Poniverse\Ponyfm\Track::class, function(\Faker\Generator $faker) {
|
||||
$factory->define(\Poniverse\Ponyfm\Models\Track::class, function(\Faker\Generator $faker) {
|
||||
$user = factory(User::class)->create();
|
||||
|
||||
return [
|
||||
'user_id' => $user->id,
|
||||
'hash' => $faker->md5,
|
||||
'title' => $faker->sentence(5),
|
||||
'track_type_id' => \Poniverse\Ponyfm\TrackType::UNCLASSIFIED_TRACK,
|
||||
'track_type_id' => \Poniverse\Ponyfm\Models\TrackType::UNCLASSIFIED_TRACK,
|
||||
'genre' => $faker->word,
|
||||
'album' => $faker->sentence(5),
|
||||
'track_number' => null,
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTrackHashes extends Migration
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class UpdateTrackHash extends Migration
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
|
||||
class AddTrackFilesForDeletedTracks extends Migration
|
||||
{
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Pony.fm - A community for pony fan music.
|
||||
* Copyright (C) 2015 Peter Deltchev
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class UpdateModelNamespacesInRevisions extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::table('revisions')
|
||||
->update(['revisionable_type' => DB::raw("replace(revisionable_type, 'Poniverse\\\\Ponyfm', 'Poniverse\\\\Ponyfm\\\\Models')")]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
DB::table('revisions')
|
||||
->update(['revisionable_type' => DB::raw("replace(revisionable_type, 'Poniverse\\\\Ponyfm\\\\Models', 'Poniverse\\\\Ponyfm')")]);
|
||||
}
|
||||
}
|
|
@ -49,7 +49,7 @@
|
|||
@if (Auth::check())
|
||||
<div class="user-details dropdown">
|
||||
<a class="avatar dropdown-toggle" href="#">
|
||||
<img src="{{Auth::user()->getAvatarUrl(\Poniverse\Ponyfm\Image::THUMBNAIL)}}" />
|
||||
<img src="{{Auth::user()->getAvatarUrl(\Poniverse\Ponyfm\Models\Image::THUMBNAIL)}}" />
|
||||
<span><i class="icon-chevron-down"></i></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<div class="player loading {{Auth::check() ? 'can-favourite' : ''}} {{$user['is_favourited'] ? 'favourited' : ''}}" data-track-id="{{ $track->id }}" data-duration="{{ $track->duration * 1000 }}">
|
||||
<div class="play" disabled="disabled">
|
||||
<div class="button"><i class="icon-play"></i></div>
|
||||
<img src="{{ $track->getCoverUrl(\Poniverse\Ponyfm\Image::SMALL) }}" />
|
||||
<img src="{{ $track->getCoverUrl(\Poniverse\Ponyfm\Models\Image::SMALL) }}" />
|
||||
</div>
|
||||
<div class="meta">
|
||||
@if (Auth::check())
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
|
||||
class ApiAuthTest extends TestCase {
|
||||
use DatabaseMigrations;
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
|
||||
class ApiTest extends TestCase {
|
||||
use DatabaseMigrations;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
use Poniverse\Ponyfm\User;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
|
||||
/**
|
||||
* Pony.fm - A community for pony fan music.
|
||||
|
|
Loading…
Reference in a new issue