support deleting and canceling live tv recordings and timers

This commit is contained in:
Luke Pulverenti 2013-11-29 11:58:24 -05:00
parent 8dd607af86
commit ac0cc84f9d
14 changed files with 181 additions and 75 deletions

View File

@ -506,6 +506,20 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
});
};
self.createLiveTvTimer = function (options) {
if (!options) {
throw new Error("null options");
}
var url = self.getUrl("LiveTv/Timers", options);
return self.ajax({
type: "POST",
url: url
});
};
/**
* Gets the current server status
*/
@ -1019,9 +1033,11 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
/**
* Gets the server's scheduled tasks
*/
self.getScheduledTasks = function () {
self.getScheduledTasks = function (options) {
var url = self.getUrl("ScheduledTasks");
options = options || {};
var url = self.getUrl("ScheduledTasks", options);
return self.ajax({
type: "GET",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -362,7 +362,7 @@ a.itemTag:hover {
}
.itemBackdropContent {
height: 230px;
height: 245px;
}
.lnkSibling {
@ -396,7 +396,7 @@ a.itemTag:hover {
}
.itemDetailImage {
height: 240px;
height: 255px;
-moz-box-shadow: 0px 0 20px #000;
-webkit-box-shadow: 0px 0 20px #000;
box-shadow: 0px 0 20px #000;

View File

@ -717,8 +717,8 @@ progress {
/* Detail Page*/
.imgUserItemRating {
height: 17px;
width: 17px;
height: 16px;
width: 16px;
margin-right: 1em;
cursor: pointer;
vertical-align: top;
@ -728,10 +728,6 @@ progress {
opacity: .5;
}
.imgPlayed, .imgPlayedOff {
border-radius: 4px;
}
/* Now playing bar */
#nowPlayingBar {
padding: 6px .5em;
@ -1042,6 +1038,34 @@ input[type="range"]::-ms-fill-upper {
}
}
@media (min-width: 1700px) {
.itemVideo:not(.fullscreenVideo) {
width: 500px;
}
.positionSlider {
width: 500px;
}
.itemVideo {
left: -660px;
}
}
@media (min-width: 2400px) {
.itemVideo:not(.fullscreenVideo) {
width: 550px;
}
.positionSlider {
width: 550px;
}
.itemVideo {
left: -710px;
}
}
#editItemMetadataPage #txtOverview {
height: 70px;
}

View File

@ -112,11 +112,6 @@
font-weight: normal;
}
.tileItem .userDataIcons img {
height: 18px;
width: 18px;
}
@media all and (min-width: 540px) {
.tileItem {
@ -190,10 +185,6 @@
display: inline-block;
}
.smallBackdropTileItem .tileImage {
height: 95px;
}
.backdropTileItem .tileImage {
height: 105px;
}
@ -257,10 +248,6 @@
.smallPosterTileItem {
width: 22%;
}
.smallBackdropTileItem {
width: 30%;
}
}
@media all and (min-width: 1440px) {

View File

@ -48,7 +48,7 @@
</div>
<div style="vertical-align: bottom; display: inline-block;">
<div id="fldDelete" style="display: none;">
<button id="btnDelete" type="button" data-icon="delete" data-mini="true" data-theme="a" data-inline="true">Delete</button>
<button id="btnDelete" type="button" data-icon="delete" data-mini="true" data-inline="true">Delete Item</button>
</div>
</div>
</div>
@ -152,7 +152,7 @@
<option value='Saturday'>Saturday</option>
<option value='Sunday'>Sunday</option>
</select>
<a data-role="button" data-theme="b" data-inline="true" data-mini="true" data-icon="plus" data-iconpos="notext" onclick="EditItemMetadataPage.addElementToEditableListview(this,EditItemMetadataPage.sortDaysOfTheWeek)">Add</a>
<a data-role="button" data-theme="b" data-inline="true" data-mini="true" data-icon="plus" data-iconpos="notext" onclick="EditItemMetadataPage.addElementToEditableListview(this,EditItemMetadataPage.sortDaysOfTheWeek)" style="vertical-align: top;">Add</a>
</div>
<ul data-role="listview" data-inset="true" data-split-icon="delete" id="listAirDays"></ul>
</div>
@ -214,28 +214,28 @@
<div style="display: inline-block; width: 250px;">
<input class="txtProviderId" id="txtGamesDb" name="txtGamesDb" data-mini="true" />
</div>
<a id="btnOpenGamesDb" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button"></a>
<a id="btnOpenGamesDb" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button" style="vertical-align: top;"></a>
</div>
<div data-role="fieldcontain" id="fldImdb" style="display: none;">
<label for="txtImdb">Imdb:</label>
<div style="display: inline-block; width: 250px;">
<input class="txtProviderId" id="txtImdb" name="txtImdb" data-mini="true" />
</div>
<a id="btnOpenImdb" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button"></a>
<a id="btnOpenImdb" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button" style="vertical-align: top;"></a>
</div>
<div data-role="fieldcontain" id="fldMusicBrainz" style="display: none;">
<label for="txtMusicBrainz">MusicBrainz:</label>
<div style="display: inline-block; width: 250px;">
<input class="txtProviderId" id="txtMusicBrainz" name="txtMusicBrainz" data-mini="true" />
</div>
<a id="btnOpenMusicbrainz" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button"></a>
<a id="btnOpenMusicbrainz" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button" style="vertical-align: top;"></a>
</div>
<div data-role="fieldcontain" id="fldMusicBrainzReleaseGroupId" style="display: none;">
<label for="txtMusicBrainzReleaseGroupId">MusicBrainz Release Group Id:</label>
<div style="display: inline-block; width: 250px;">
<input class="txtProviderId" id="txtMusicBrainzReleaseGroupId" name="txtMusicBrainzReleaseGroupId" data-mini="true" />
</div>
<a id="btnOpenMusicbrainzReleaseGroup" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button"></a>
<a id="btnOpenMusicbrainzReleaseGroup" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button" style="vertical-align: top;"></a>
</div>
<div data-role="fieldcontain" id="fldRottenTomatoes" style="display: none;">
<label for="txtRottenTomatoes">Rotten Tomatoes:</label>
@ -248,14 +248,14 @@
<div style="display: inline-block; width: 250px;">
<input class="txtProviderId" id="txtTmdb" name="txtTmdb" data-mini="true" />
</div>
<a id="btnOpenTmdb" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button"></a>
<a id="btnOpenTmdb" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button" style="vertical-align: top;"></a>
</div>
<div data-role="fieldcontain" id="fldTvdb" style="display: none;">
<label for="txtTvdb">TheTVDB:</label>
<div style="display: inline-block; width: 250px;">
<input class="txtProviderId" id="txtTvdb" name="txtTvdb" data-mini="true" />
</div>
<a id="btnOpenTvdb" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button"></a>
<a id="btnOpenTvdb" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button" style="vertical-align: top;"></a>
</div>
<div data-role="fieldcontain" id="fldTvCom" style="display: none;">
<label for="txtTvCom">TV.com:</label>
@ -268,21 +268,21 @@
<div style="display: inline-block; width: 250px;">
<input class="txtProviderId" id="txtZap2It" name="txtZap2It" data-mini="true" />
</div>
<a id="btnOpenZap2It" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button"></a>
<a id="btnOpenZap2It" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button" style="vertical-align: top;"></a>
</div>
<div data-role="fieldcontain" id="fldNesBoxName" style="display: none;">
<label for="txtNesBoxName">NES/SNESbox Name:</label>
<div style="display: inline-block; width: 250px;">
<input class="txtProviderId" id="txtNesBoxName" name="txtNesBoxName" data-mini="true" />
</div>
<a id="btnOpenNesBox" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button"></a>
<a id="btnOpenNesBox" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button" style="vertical-align: top;"></a>
</div>
<div data-role="fieldcontain" id="fldNesBoxRom" style="display: none;">
<label for="txtNesBoxRom">NES/SNESbox Game Id:</label>
<div style="display: inline-block; width: 250px;">
<input class="txtProviderId" id="txtNesBoxRom" name="txtNesBoxRom" data-mini="true" />
</div>
<a id="btnOpenNesBoxRom" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button"></a>
<a id="btnOpenNesBoxRom" href="#" target="_blank" data-icon="arrow-right" data-inline="true" data-iconpos="notext" data-role="button" style="vertical-align: top;"></a>
</div>
</div>
</div>
@ -291,7 +291,7 @@
<div data-role="editableListviewContainer">
<div data-role="fieldcontain">
<input type="text" data-mini="true" />
<a data-role="button" data-theme="b" data-inline="true" data-mini="true" data-icon="plus" data-iconpos="notext" onclick="EditItemMetadataPage.addElementToEditableListview(this)">Add</a>
<a data-role="button" data-theme="b" data-inline="true" data-mini="true" data-icon="plus" data-iconpos="notext" onclick="EditItemMetadataPage.addElementToEditableListview(this)" style="vertical-align: top;">Add</a>
</div>
<ul data-role="listview" data-inset="true" data-split-icon="delete" id="listGenres"></ul>
</div>
@ -301,7 +301,7 @@
<div data-role="editableListviewContainer">
<div data-role="fieldcontain">
<input type="text" data-mini="true" />
<a data-role="button" data-theme="b" data-inline="true" data-mini="true" data-icon="plus" data-iconpos="notext" onclick="EditItemMetadataPage.addElementToEditableListview(this)">Add</a>
<a data-role="button" data-theme="b" data-inline="true" data-mini="true" data-icon="plus" data-iconpos="notext" onclick="EditItemMetadataPage.addElementToEditableListview(this)" style="vertical-align: top;">Add</a>
</div>
<ul data-role="listview" data-inset="true" data-split-icon="delete" id="listStudios"></ul>
</div>
@ -311,7 +311,7 @@
<div data-role="editableListviewContainer">
<div data-role="fieldcontain">
<input type="text" data-mini="true" />
<a data-role="button" data-theme="b" data-inline="true" data-mini="true" data-icon="plus" data-iconpos="notext" onclick="EditItemMetadataPage.addElementToEditableListview(this)">Add</a>
<a data-role="button" data-theme="b" data-inline="true" data-mini="true" data-icon="plus" data-iconpos="notext" onclick="EditItemMetadataPage.addElementToEditableListview(this)" style="vertical-align: top;">Add</a>
</div>
<ul data-role="listview" data-inset="true" data-split-icon="delete" id="listTags"></ul>
</div>

View File

@ -399,7 +399,7 @@
var options = {
userId: Dashboard.getCurrentUserId(),
limit: item.Type == "MusicAlbum" ? 6 : 8,
limit: item.Type == "MusicAlbum" ? 6 : 6,
fields: "PrimaryImageAspectRatio,DateCreated,UserData"
};

View File

@ -1506,9 +1506,9 @@
if ((item.MediaType || item.IsFolder) && item.Type != "Channel" && item.Type != "MusicArtist") {
if (userData.Played) {
html += '<img data-type="' + type + '" data-itemid="' + itemId + '" class="imgUserItemRating imgPlayed" src="css/images/userdata/playedon.png" alt="Played" title="Played" onclick="LibraryBrowser.markPlayed(this);return false;" />';
html += '<img data-type="' + type + '" data-itemid="' + itemId + '" class="imgUserItemRating imgPlayed" src="css/images/userdata/checkedon.png" alt="Played" title="Played" onclick="LibraryBrowser.markPlayed(this);return false;" />';
} else {
html += '<img data-type="' + type + '" data-itemid="' + itemId + '" class="imgUserItemRating imgPlayedOff" src="css/images/userdata/playedoff.png" alt="Played" title="Played" onclick="LibraryBrowser.markPlayed(this);return false;" />';
html += '<img data-type="' + type + '" data-itemid="' + itemId + '" class="imgUserItemRating imgPlayedOff" src="css/images/userdata/checkedoff.png" alt="Played" title="Played" onclick="LibraryBrowser.markPlayed(this);return false;" />';
}
}
@ -1549,10 +1549,10 @@
}
if (markAsPlayed) {
link.src = "css/images/userdata/playedon.png";
link.src = "css/images/userdata/checkedon.png";
$link.addClass('imgPlayed').removeClass('imgPlayedOff');
} else {
link.src = "css/images/userdata/playedoff.png";
link.src = "css/images/userdata/checkedoff.png";
$link.addClass('imgPlayedOff').removeClass('imgPlayed');
}
},
@ -1713,53 +1713,55 @@
var url;
var imageHeight = 510;
if (imageTags.Primary) {
if (item.Type == "Channel") {
url = ApiClient.getUrl("LiveTV/Channels/" + item.Id + "/Images/Primary", {
maxheight: 480,
maxheight: imageHeight,
tag: imageTags.Primary,
type: "Primary"
});
}
else if (item.Type == "Person") {
url = ApiClient.getPersonImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: imageTags.Primary,
type: "Primary"
});
}
else if (item.Type == "Genre") {
url = ApiClient.getGenreImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: imageTags.Primary,
type: "Primary"
});
}
else if (item.Type == "MusicGenre") {
url = ApiClient.getMusicGenreImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: imageTags.Primary,
type: "Primary"
});
}
else if (item.Type == "GameGenre") {
url = ApiClient.getGameGenreImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: imageTags.Primary,
type: "Primary"
});
}
else if (item.Type == "Studio") {
url = ApiClient.getStudioImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: imageTags.Primary,
type: "Primary"
});
}
else if (item.Type == "MusicArtist") {
url = ApiClient.getArtistImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: imageTags.Primary,
type: "Primary"
});
@ -1767,7 +1769,7 @@
else {
url = ApiClient.getImageUrl(item.Id, {
type: "Primary",
maxheight: 480,
maxheight: imageHeight,
tag: item.ImageTags.Primary
});
}
@ -1776,42 +1778,42 @@
if (item.Type == "Person") {
url = ApiClient.getPersonImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: item.BackdropImageTags[0],
type: "Backdrop"
});
}
else if (item.Type == "Genre") {
url = ApiClient.getGenreImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: item.BackdropImageTags[0],
type: "Backdrop"
});
}
else if (item.Type == "MusicGenre") {
url = ApiClient.getMusicGenreImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: item.BackdropImageTags[0],
type: "Backdrop"
});
}
else if (item.Type == "GameGenre") {
url = ApiClient.getGameGenreImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: item.BackdropImageTags[0],
type: "Backdrop"
});
}
else if (item.Type == "Studio") {
url = ApiClient.getStudioImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: item.BackdropImageTags[0],
type: "Backdrop"
});
}
else if (item.Type == "MusicArtist") {
url = ApiClient.getArtistImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: item.BackdropImageTags[0],
type: "Backdrop"
});
@ -1819,7 +1821,7 @@
else {
url = ApiClient.getImageUrl(item.Id, {
type: "Backdrop",
maxheight: 480,
maxheight: imageHeight,
tag: item.BackdropImageTags[0]
});
}
@ -1828,42 +1830,42 @@
if (item.Type == "Person") {
url = ApiClient.getPersonImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: imageTags.Thumb,
type: "Thumb"
});
}
else if (item.Type == "Genre") {
url = ApiClient.getGenreImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: imageTags.Thumb,
type: "Thumb"
});
}
else if (item.Type == "MusicGenre") {
url = ApiClient.getMusicGenreImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: imageTags.Thumb,
type: "Thumb"
});
}
else if (item.Type == "GameGenre") {
url = ApiClient.getGameGenreImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: imageTags.Thumb,
type: "Thumb"
});
}
else if (item.Type == "Studio") {
url = ApiClient.getStudioImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: imageTags.Thumb,
type: "Thumb"
});
}
else if (item.Type == "MusicArtist") {
url = ApiClient.getArtistImageUrl(item.Name, {
maxheight: 480,
maxheight: imageHeight,
tag: imageTags.Thumb,
type: "Thumb"
});
@ -1871,7 +1873,7 @@
else {
url = ApiClient.getImageUrl(item.Id, {
type: "Thumb",
maxheight: 480,
maxheight: imageHeight,
tag: item.ImageTags.Thumb
});
}
@ -1880,7 +1882,7 @@
url = ApiClient.getImageUrl(item.Id, {
type: "Disc",
maxheight: 480,
maxheight: imageHeight,
tag: item.ImageTags.Disc
});
}
@ -1888,7 +1890,7 @@
url = ApiClient.getImageUrl(item.AlbumId, {
type: "Primary",
maxheight: 480,
maxheight: imageHeight,
tag: item.AlbumPrimaryImageTag
});
@ -2007,7 +2009,7 @@
}
}
if (item.RunTimeTicks) {
if (item.RunTimeTicks && item.Type != "Series") {
if (item.Type == "Audio") {
@ -2349,7 +2351,7 @@
if (user.PrimaryImageTag) {
var url = ApiClient.getUserImageUrl(user.Id, {
width: 225,
height: 40,
tag: user.PrimaryImageTag,
type: "Primary"
});

View File

@ -1,7 +1,30 @@
(function ($, document, apiClient) {
function playRecording(page, id) {
}
function deleteRecording(page, id) {
Dashboard.confirm("Are you sure you wish to delete this recording?", "Confirm Recording Deletion", function (result) {
if (result) {
Dashboard.showLoadingMsg();
ApiClient.deleteLiveTvRecording(id).done(function () {
Dashboard.alert('Recording deleted');
reload(page);
});
}
});
}
function renderRecordings(page, recordings) {
var html = '';
var cssClass = "detailTable";
@ -28,7 +51,6 @@
html += '<td>';
html += '<button data-recordingid="' + recording.Id + '" class="btnPlayRecording" type="button" data-icon="play" data-inline="true" data-mini="true" data-iconpos="notext">Play</button>';
html += '<button data-recordingid="' + recording.Id + '" class="btnEditRecording" type="button" data-icon="pencil" data-inline="true" data-mini="true" data-iconpos="notext">Edit</button>';
html += '<button data-recordingid="' + recording.Id + '" class="btnDeleteRecording" type="button" data-icon="delete" data-inline="true" data-mini="true" data-iconpos="notext">Delete</button>';
html += '</td>';
@ -59,17 +81,35 @@
html += '</table></div>';
var elem = $('#items', page).html(html).trigger('create');
$('.btnPlayRecording', elem).on('click', function () {
var recordingId = this.getAttribute('data-recordingid');
playRecording(page, recordingId);
});
$('.btnDeleteRecording', elem).on('click', function () {
var recordingId = this.getAttribute('data-recordingid');
deleteRecording(page, recordingId);
});
Dashboard.hideLoadingMsg();
}
function reload(page) {
apiClient.getLiveTvRecordings().done(function(result) {
Dashboard.showLoadingMsg();
apiClient.getLiveTvRecordings().done(function (result) {
renderRecordings(page, result.Items);
});
}
$(document).on('pagebeforeshow', "#liveTvRecordingsPage", function () {
var page = this;

View File

@ -1,5 +1,28 @@
(function ($, document, apiClient) {
function editTimer(page, id) {
}
function deleteTimer(page, id) {
Dashboard.confirm("Are you sure you wish to delete this timer?", "Confirm Timer Deletion", function (result) {
if (result) {
Dashboard.showLoadingMsg();
ApiClient.cancelLiveTvTimer(id).done(function () {
Dashboard.alert('Timer deleted');
reload(page);
});
}
});
}
function renderTimers(page, timers) {
var html = '';
@ -61,6 +84,20 @@
html += '</table></div>';
var elem = $('#items', page).html(html).trigger('create');
$('.btnEditTimer', elem).on('click', function () {
var id = this.getAttribute('data-timerid');
editTimer(page, id);
});
$('.btnDeleteTimer', elem).on('click', function () {
var id = this.getAttribute('data-timerid');
deleteTimer(page, id);
});
}
function reload(page) {

View File

@ -6,7 +6,7 @@
stopInterval();
}
ApiClient.getScheduledTasks().done(function (tasks) {
ApiClient.getScheduledTasks({isHidden: false}).done(function (tasks) {
if (updateInterval) {
populateList(page, tasks);

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.201" targetFramework="net45" />
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.203" targetFramework="net45" />
<package id="ServiceStack.Common" version="3.9.62" targetFramework="net45" />
<package id="ServiceStack.Text" version="3.9.62" targetFramework="net45" />
</packages>