mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixes #562 - Integrate nesbox/snesbox into web client
This commit is contained in:
parent
a1c3ebb854
commit
8140e361fb
6 changed files with 110 additions and 4 deletions
|
@ -264,6 +264,20 @@
|
||||||
</div>
|
</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"></a>
|
||||||
</div>
|
</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>
|
||||||
|
</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>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div data-role="collapsible" id="genresCollapsible" style="display: none;">
|
<div data-role="collapsible" id="genresCollapsible" style="display: none;">
|
||||||
|
|
|
@ -137,6 +137,9 @@
|
||||||
<span id="playButtonContainer" style="display: none;">
|
<span id="playButtonContainer" style="display: none;">
|
||||||
<button id="btnPlay" type="button" data-icon="play" data-inline="true" data-mini="true">Play</button>
|
<button id="btnPlay" type="button" data-icon="play" data-inline="true" data-mini="true">Play</button>
|
||||||
</span>
|
</span>
|
||||||
|
<span id="playExternalButtonContainer" style="display: none;">
|
||||||
|
<a id="btnPlayExternal" data-role="button" data-icon="play" data-inline="true" data-mini="true" href="#" target="_blank">Play</a>
|
||||||
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<button id="btnRemote" type="button" data-icon="hand-up" data-inline="true" data-mini="true">Remote</button>
|
<button id="btnRemote" type="button" data-icon="hand-up" data-inline="true" data-mini="true">Remote</button>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -64,9 +64,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MediaPlayer.canPlay(item) && item.LocationType !== "Offline" && item.LocationType !== "Virtual") {
|
if (MediaPlayer.canPlay(item) && item.LocationType !== "Offline" && item.LocationType !== "Virtual") {
|
||||||
|
|
||||||
|
var url = MediaPlayer.getPlayUrl(item);
|
||||||
|
|
||||||
|
if (url) {
|
||||||
|
$('#playExternalButtonContainer', page).show();
|
||||||
|
$('#playButtonContainer', page).hide();
|
||||||
|
} else {
|
||||||
$('#playButtonContainer', page).show();
|
$('#playButtonContainer', page).show();
|
||||||
|
$('#playExternalButtonContainer', page).hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#btnPlayExternal', page).attr('href', url || '#');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$('#playButtonContainer', page).hide();
|
$('#playButtonContainer', page).hide();
|
||||||
|
$('#playExternalButtonContainer', page).hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
$(".autoNumeric").autoNumeric('init');
|
$(".autoNumeric").autoNumeric('init');
|
||||||
|
|
|
@ -425,6 +425,14 @@
|
||||||
$('#fldGamesDb', page).hide();
|
$('#fldGamesDb', page).hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.MediaType == "Game" && (item.GameSystem == "Nintendo" || item.GameSystem == "Super Nintendo")) {
|
||||||
|
$('#fldNesBoxName', page).show();
|
||||||
|
$('#fldNesBoxRom', page).show();
|
||||||
|
} else {
|
||||||
|
$('#fldNesBoxName', page).hide();
|
||||||
|
$('#fldNesBoxRom', page).hide();
|
||||||
|
}
|
||||||
|
|
||||||
if (item.MediaType == "Game") {
|
if (item.MediaType == "Game") {
|
||||||
$('#fldPlayers', page).show();
|
$('#fldPlayers', page).show();
|
||||||
} else {
|
} else {
|
||||||
|
@ -714,6 +722,8 @@
|
||||||
$('#txtMusicBrainzReleaseGroupId', page).val(providerIds.MusicBrainzReleaseGroup || "");
|
$('#txtMusicBrainzReleaseGroupId', page).val(providerIds.MusicBrainzReleaseGroup || "");
|
||||||
$('#txtRottenTomatoes', page).val(providerIds.RottenTomatoes || "");
|
$('#txtRottenTomatoes', page).val(providerIds.RottenTomatoes || "");
|
||||||
$('#txtZap2It', page).val(providerIds.Zap2It || "");
|
$('#txtZap2It', page).val(providerIds.Zap2It || "");
|
||||||
|
$('#txtNesBoxName', page).val(providerIds.NesBox || "");
|
||||||
|
$('#txtNesBoxRom', page).val(providerIds.NesBoxRom || "");
|
||||||
|
|
||||||
if (item.RunTimeTicks) {
|
if (item.RunTimeTicks) {
|
||||||
|
|
||||||
|
@ -951,7 +961,9 @@
|
||||||
Musicbrainz: $('#txtMusicBrainz', form).val(),
|
Musicbrainz: $('#txtMusicBrainz', form).val(),
|
||||||
MusicBrainzReleaseGroup: $('#txtMusicBrainzReleaseGroupId', form).val(),
|
MusicBrainzReleaseGroup: $('#txtMusicBrainzReleaseGroupId', form).val(),
|
||||||
RottenTomatoes: $('#txtRottenTomatoes', form).val(),
|
RottenTomatoes: $('#txtRottenTomatoes', form).val(),
|
||||||
Zap2It: $('#txtZap2It', form).val()
|
Zap2It: $('#txtZap2It', form).val(),
|
||||||
|
NesBox: $('#txtNesBoxName', form).val(),
|
||||||
|
NesBoxRom: $('#txtNesBoxRom', form).val()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1053,6 +1065,35 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#txtNesBoxName', this).on('change', function () {
|
||||||
|
|
||||||
|
var val = this.value;
|
||||||
|
var urlPrefix = currentItem.GameSystem == "Nintendo" ? "http://nesbox.com/game/" : "http://snesbox.com/game/";
|
||||||
|
|
||||||
|
if (val) {
|
||||||
|
|
||||||
|
$('#btnOpenNesBox', page).attr('href', urlPrefix + val);
|
||||||
|
} else {
|
||||||
|
$('#btnOpenNesBox', page).attr('href', '#');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#txtNesBoxRom', this).on('change', function () {
|
||||||
|
|
||||||
|
var val = this.value;
|
||||||
|
var romName = $('#txtNesBoxName', page).val();
|
||||||
|
var urlPrefix = currentItem.GameSystem == "Nintendo" ? "http://nesbox.com/game/" : "http://snesbox.com/game/";
|
||||||
|
|
||||||
|
if (val && romName) {
|
||||||
|
|
||||||
|
$('#btnOpenNesBoxRom', page).attr('href', urlPrefix + romName + '/rom/' + val);
|
||||||
|
} else {
|
||||||
|
$('#btnOpenNesBoxRom', page).attr('href', '#');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
$('#txtImdb', this).on('change', function () {
|
$('#txtImdb', this).on('change', function () {
|
||||||
|
|
||||||
var val = this.value;
|
var val = this.value;
|
||||||
|
|
|
@ -1278,9 +1278,19 @@
|
||||||
links.push('<a class="textlink" href="http://musicbrainz.org/release-group/' + providerIds.MusicBrainzReleaseGroup + '" target="_blank">MusicBrainz Release Group</a>');
|
links.push('<a class="textlink" href="http://musicbrainz.org/release-group/' + providerIds.MusicBrainzReleaseGroup + '" target="_blank">MusicBrainz Release Group</a>');
|
||||||
|
|
||||||
}
|
}
|
||||||
if (providerIds.Gamesdb)
|
if (providerIds.Gamesdb) {
|
||||||
links.push('<a class="textlink" href="http://thegamesdb.net/game/' + providerIds.Gamesdb + '" target="_blank">GamesDB</a>');
|
links.push('<a class="textlink" href="http://thegamesdb.net/game/' + providerIds.Gamesdb + '" target="_blank">GamesDB</a>');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (providerIds.NesBox) {
|
||||||
|
|
||||||
|
if (item.GameSystem == "Nintendo") {
|
||||||
|
links.push('<a class="textlink" href="http://nesbox.com/game/' + providerIds.NesBox + '" target="_blank">NESbox</a>');
|
||||||
|
}
|
||||||
|
else if (item.GameSystem == "Super Nintendo") {
|
||||||
|
links.push('<a class="textlink" href="http://snesbox.com/game/' + providerIds.NesBox + '" target="_blank">SNESbox</a>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (providerIds.Zap2It)
|
if (providerIds.Zap2It)
|
||||||
links.push('<a class="textlink" href="http://tvlistings.zap2it.com/tv/dexter/' + providerIds.Zap2It + '?aid=zap2it" target="_blank">Zap2It</a>');
|
links.push('<a class="textlink" href="http://tvlistings.zap2it.com/tv/dexter/' + providerIds.Zap2It + '?aid=zap2it" target="_blank">Zap2It</a>');
|
||||||
|
|
|
@ -750,9 +750,34 @@
|
||||||
if (item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "Artist" || item.Type == "MusicGenre") {
|
if (item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "Artist" || item.Type == "MusicGenre") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.GameSystem == "Nintendo" && item.MediaType == "Game" && item.ProviderIds.NesBox && item.ProviderIds.NesBoxRom) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.GameSystem == "Super Nintendo" && item.MediaType == "Game" && item.ProviderIds.NesBox && item.ProviderIds.NesBoxRom) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return self.canPlayMediaType(item.MediaType);
|
return self.canPlayMediaType(item.MediaType);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.getPlayUrl = function(item) {
|
||||||
|
|
||||||
|
|
||||||
|
if (item.GameSystem == "Nintendo" && item.MediaType == "Game" && item.ProviderIds.NesBox && item.ProviderIds.NesBoxRom) {
|
||||||
|
|
||||||
|
return "http://nesbox.com/game/" + item.ProviderIds.NesBox + '/rom/' + item.ProviderIds.NesBoxRom;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.GameSystem == "Super Nintendo" && item.MediaType == "Game" && item.ProviderIds.NesBox && item.ProviderIds.NesBoxRom) {
|
||||||
|
|
||||||
|
return "http://snesbox.com/game/" + item.ProviderIds.NesBox + '/rom/' + item.ProviderIds.NesBoxRom;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
self.canPlayMediaType = function (mediaType) {
|
self.canPlayMediaType = function (mediaType) {
|
||||||
|
|
||||||
var media;
|
var media;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue