mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 07:46:05 -07:00
51 lines
No EOL
1.3 KiB
JavaScript
51 lines
No EOL
1.3 KiB
JavaScript
(function () {
|
|
var controller = function($scope, requestsService) {
|
|
|
|
$scope.requests = [];
|
|
$scope.selectedTab = {};
|
|
$scope.currentPage = 1;
|
|
$scope.tabs = [];
|
|
|
|
$scope.plexSettings = {};
|
|
$scope.requestSettings = {};
|
|
|
|
// Search
|
|
$scope.searchTerm = "";
|
|
|
|
|
|
// Called on page load
|
|
$scope.init = function() {
|
|
// Get the settings
|
|
$scope.plexSettings = requestsService.getPlexRequestSettings(getBaseUrl());
|
|
$scope.requestSettings = requestsService.getRequestSettings(getBaseUrl());
|
|
|
|
if ($scope.plexSettings.SearchForMovies) {
|
|
$scope.selectedTab = "movies";
|
|
|
|
// Load the movie Requests
|
|
$scope.requests = requestsService.getRequests("movie", getBaseUrl());
|
|
}
|
|
};
|
|
|
|
|
|
$scope.changeTab = function(tab) {
|
|
// load the data from the tab
|
|
switch (tab) {
|
|
// Set the selected tab and load the appropriate data
|
|
}
|
|
|
|
};
|
|
|
|
$scope.search = function() {
|
|
$scope.requests = requestsService.getRequests
|
|
};
|
|
|
|
function getBaseUrl() {
|
|
return $('#baseUrl').val();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
angular.module('PlexRequests').controller('requestsController', ["$scope", "requestsService", controller]);
|
|
}()); |