"use strict";

App.factory('MediaMusicTrack', function ($rootScope, $http, Url) {

    var factory = {};

    factory.value_id = null;

    factory.findByAlbum = function (album_id) {

        if (!this.value_id) {
            console.error('value_id is not defined.');
            return;
        }
        return $http({
            method: 'GET',
            url: Url.get("media/mobile_api_music_track/findbyalbum", {
                value_id: this.value_id,
                album_id: album_id
            }),
            cache: !$rootScope.isOverview,
            responseType: 'json'
        });
    };

    return factory;
});