Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a common error message and update some strings #1896

Merged
merged 2 commits into from Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 8 additions & 12 deletions src/components/playback/playbackmanager.js
Expand Up @@ -639,22 +639,18 @@ function supportsDirectPlay(apiClient, item, mediaSource) {

function validatePlaybackInfoResult(instance, result) {
if (result.ErrorCode) {
showPlaybackInfoErrorMessage(instance, result.ErrorCode);
showPlaybackInfoErrorMessage(instance, 'PlaybackError' + result.ErrorCode);
return false;
}

return true;
}

function showPlaybackInfoErrorMessage(instance, errorCode, playNextTrack) {
function showPlaybackInfoErrorMessage(instance, errorCode) {
import('alert').then(({ default: alert }) => {
alert({
text: globalize.translate('PlaybackError' + errorCode),
text: globalize.translate(errorCode),
title: globalize.translate('HeaderPlaybackError')
}).then(function () {
if (playNextTrack) {
instance.nextTrack();
}
});
});
}
Expand Down Expand Up @@ -1701,7 +1697,7 @@ class PlaybackManager {
streamInfo.lastMediaInfoQuery = lastMediaInfoQuery;

if (!streamInfo.url) {
showPlaybackInfoErrorMessage(self, 'NoCompatibleStream', true);
showPlaybackInfoErrorMessage(self, 'PlaybackErrorNoCompatibleStream');
return;
}

Expand Down Expand Up @@ -2061,7 +2057,7 @@ class PlaybackManager {

// If it's still null then there's nothing to play
if (!firstItem) {
showPlaybackInfoErrorMessage(self, 'NoCompatibleStream', false);
showPlaybackInfoErrorMessage(self, 'PlaybackErrorNoCompatibleStream');
return Promise.reject();
}

Expand Down Expand Up @@ -2110,7 +2106,7 @@ class PlaybackManager {
function playInternal(item, playOptions, onPlaybackStartedFn) {
if (item.IsPlaceHolder) {
loading.hide();
showPlaybackInfoErrorMessage(self, 'PlaceHolder', true);
showPlaybackInfoErrorMessage(self, 'PlaybackErrorPlaceHolder');
return Promise.reject();
}

Expand Down Expand Up @@ -2479,7 +2475,7 @@ class PlaybackManager {
return mediaSource;
}
} else {
showPlaybackInfoErrorMessage(self, 'NoCompatibleStream');
showPlaybackInfoErrorMessage(self, 'PlaybackErrorNoCompatibleStream');
return Promise.reject();
}
});
Expand Down Expand Up @@ -2968,7 +2964,7 @@ class PlaybackManager {
}

if (displayErrorCode && typeof (displayErrorCode) === 'string') {
showPlaybackInfoErrorMessage(self, displayErrorCode, nextItem);
showPlaybackInfoErrorMessage(self, 'PlaybackError' + displayErrorCode);
} else if (nextItem) {
self.nextTrack();
} else {
Expand Down
32 changes: 16 additions & 16 deletions src/controllers/dashboard/dlna/profile.html
Expand Up @@ -33,11 +33,11 @@ <h3 class="checkboxListLabel">${LabelSupportedMediaTypes}</h3>
</label>
<label>
<input is="emby-checkbox" type="checkbox" id="chkPhoto" data-value="Photo" class="chkMediaType" />
<span>${OptionProfilePhoto}</span>
<span>${Photo}</span>
</label>
<label>
<input is="emby-checkbox" type="checkbox" id="chkVideo" data-value="Video" class="chkMediaType" />
<span>${OptionProfileVideo}</span>
<span>${Video}</span>
</label>
</div>
</div>
Expand Down Expand Up @@ -144,19 +144,19 @@ <h2 style="vertical-align:middle;display:inline-block;">${HeaderHttpHeaders}</h2
</div>
<div class="inputContainer">
<input type="number" is="emby-input" id="txtAlbumArtMaxWidth" pattern="[0-9]*" min="1" label="${LabelAlbumArtMaxWidth}" />
<div class="fieldDescription">${LabelAlbumArtMaxWidthHelp}</div>
<div class="fieldDescription">${LabelAlbumArtMaxResHelp}</div>
</div>
<div class="inputContainer">
<input type="number" is="emby-input" id="txtAlbumArtMaxHeight" pattern="[0-9]*" min="1" label="${LabelAlbumArtMaxHeight}" />
<div class="fieldDescription">${LabelAlbumArtMaxHeightHelp}</div>
<div class="fieldDescription">${LabelAlbumArtMaxResHelp}</div>
</div>
<div class="inputContainer">
<input type="number" is="emby-input" id="txtIconMaxWidth" pattern="[0-9]*" min="1" label="${LabelIconMaxWidth}" />
<div class="fieldDescription">${LabelIconMaxWidthHelp}</div>
<div class="fieldDescription">${LabelIconMaxResHelp}</div>
</div>
<div class="inputContainer">
<input type="number" is="emby-input" id="txtIconMaxHeight" pattern="[0-9]*" min="1" label="${LabelIconMaxHeight}" />
<div class="fieldDescription">${LabelIconMaxHeightHelp}</div>
<div class="fieldDescription">${LabelIconMaxResHelp}</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -280,8 +280,8 @@ <h3 class="sectionTitle">${HeaderDirectPlayProfile}</h3>
<div class="selectContainer">
<select id="selectDirectPlayProfileType" name="selectDirectPlayProfileType" is="emby-select" label="${LabelType}">
<option value="Audio">${Audio}</option>
<option value="Photo">${OptionProfilePhoto}</option>
<option value="Video">${OptionProfileVideo}</option>
<option value="Photo">${Photo}</option>
<option value="Video">${Video}</option>
</select>
</div>
<div class="inputContainer">
Expand Down Expand Up @@ -328,8 +328,8 @@ <h3 class="sectionTitle">${HeaderTranscodingProfile}</h3>
<div class="selectContainer">
<select id="selectTranscodingProfileType" name="selectTranscodingProfileType" is="emby-select" label="${LabelType}">
<option value="Audio">${Audio}</option>
<option value="Photo">${OptionProfilePhoto}</option>
<option value="Video">${OptionProfileVideo}</option>
<option value="Photo">${Photo}</option>
<option value="Video">${Video}</option>
</select>
</div>
<div id="fldTranscodingProtocol" style="margin: 1em 0;">
Expand Down Expand Up @@ -404,8 +404,8 @@ <h3 class="sectionTitle">${HeaderContainerProfile}</h3>
<div class="selectContainer">
<select id="selectContainerProfileType" name="selectContainerProfileType" is="emby-select" label="${LabelType}">
<option value="Audio">${Audio}</option>
<option value="Photo">${OptionProfilePhoto}</option>
<option value="Video">${OptionProfileVideo}</option>
<option value="Photo">${Photo}</option>
<option value="Video">${Video}</option>
</select>
</div>
<div class="inputContainer">
Expand Down Expand Up @@ -434,8 +434,8 @@ <h3 class="sectionTitle">${HeaderCodecProfile}</h3>
<p>${HeaderCodecProfileHelp}</p>
<div class="selectContainer">
<select id="selectCodecProfileType" name="selectCodecProfileType" is="emby-select" label="${LabelType}">
<option value="Video">${OptionProfileVideo}</option>
<option value="VideoAudio">${OptionProfileVideoAudio}</option>
<option value="Video">${Video}</option>
<option value="VideoAudio">${VideoAudio}</option>
<option value="Audio">${Audio}</option>
</select>
</div>
Expand Down Expand Up @@ -463,8 +463,8 @@ <h3 class="sectionTitle">${HeaderResponseProfile}</h3>
<div class="selectContainer">
<select id="selectResponseProfileType" name="selectResponseProfileType" is="emby-select" label="${LabelType}">
<option value="Audio">${Audio}</option>
<option value="Photo">${OptionProfilePhoto}</option>
<option value="Video">${OptionProfileVideo}</option>
<option value="Photo">${Photo}</option>
<option value="Video">${Video}</option>
</select>
</div>
<div class="inputContainer">
Expand Down
14 changes: 7 additions & 7 deletions src/controllers/dashboard/library.js
Expand Up @@ -218,29 +218,29 @@ import 'emby-itemrefreshindicator';
name: '',
value: ''
}, {
name: globalize.translate('FolderTypeMovies'),
name: globalize.translate('Movies'),
value: 'movies',
message: getLink('MovieLibraryHelp', 'https://docs.jellyfin.org/general/server/media/movies.html')
}, {
name: globalize.translate('FolderTypeMusic'),
name: globalize.translate('TabMusic'),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't feel like replacing the key everywhere it shows up but let me know if this is a blocker.

value: 'music',
message: getLink('MusicLibraryHelp', 'https://docs.jellyfin.org/general/server/media/music.html')
}, {
name: globalize.translate('FolderTypeTvShows'),
name: globalize.translate('Shows'),
value: 'tvshows',
message: getLink('TvLibraryHelp', 'https://docs.jellyfin.org/general/server/media/shows.html')
}, {
name: globalize.translate('FolderTypeBooks'),
name: globalize.translate('Books'),
value: 'books',
message: getLink('BookLibraryHelp', 'https://docs.jellyfin.org/general/server/media/books.html')
}, {
name: globalize.translate('Photos'),
value: 'homevideos'
}, {
name: globalize.translate('FolderTypeMusicVideos'),
name: globalize.translate('MusicVideos'),
value: 'musicvideos'
}, {
name: globalize.translate('FolderTypeUnset'),
name: globalize.translate('Other'),
value: 'mixed',
message: globalize.translate('MessageUnsetContentHelp')
}];
Expand Down Expand Up @@ -326,7 +326,7 @@ import 'emby-itemrefreshindicator';
let typeName = getCollectionTypeOptions().filter(function (t) {
return t.value == virtualFolder.CollectionType;
})[0];
typeName = typeName ? typeName.name : globalize.translate('FolderTypeUnset');
typeName = typeName ? typeName.name : globalize.translate('Other');
html += "<div class='cardText cardText-secondary'>";

if (virtualFolder.showType === false) {
Expand Down
5 changes: 5 additions & 0 deletions src/strings/en-us.json
Expand Up @@ -244,6 +244,7 @@
"General": "General",
"Genre": "Genre",
"Genres": "Genres",
"Other": "Other",
"GroupBySeries": "Group by series",
"GroupVersions": "Group versions",
"GuestStar": "Guest star",
Expand Down Expand Up @@ -467,6 +468,7 @@
"LabelAirsBeforeEpisode": "Airs before episode:",
"LabelAirsBeforeSeason": "Airs before season:",
"LabelAlbum": "Album:",
"LabelAlbumArtMaxResHelp": "Maximum resolution of album art exposed via the upnp:albumArtURI property.",
"LabelAlbumArtHelp": "PN used for album art, within the dlna:profileID attribute on upnp:albumArtURI. Some devices require a specific value, regardless of the size of the image.",
"LabelAlbumArtMaxHeight": "Album art max height:",
"LabelAlbumArtMaxHeightHelp": "Max resolution of album art exposed via upnp:albumArtURI.",
Expand Down Expand Up @@ -593,6 +595,7 @@
"LabelHomeScreenSectionValue": "Home screen section {0}:",
"LabelHttpsPort": "Local HTTPS port number:",
"LabelHttpsPortHelp": "The TCP port number for the HTTPS server.",
"LabelIconMaxResHelp": "Maximum resolution of icons exposed via the upnp:icon property.",
"LabelIconMaxHeight": "Icon maximum height:",
"LabelIconMaxHeightHelp": "Maximum resolution of icons exposed via upnp:icon.",
"LabelIconMaxWidth": "Icon maximum width:",
Expand Down Expand Up @@ -1115,6 +1118,7 @@
"PerfectMatch": "Perfect match",
"Person": "Person",
"Photos": "Photos",
"Photo": "Photo",
"PictureInPicture": "Picture in picture",
"PinCodeResetComplete": "The pin code has been reset.",
"PinCodeResetConfirmation": "Are you sure you wish to reset the pin code?",
Expand Down Expand Up @@ -1337,6 +1341,7 @@
"ValueVideoCodec": "Video Codec: {0}",
"Vertical": "Vertical",
"Video": "Video",
"VideoAudio": "Video Audio",
"ViewAlbum": "View album",
"ViewAlbumArtist": "View album artist",
"ViewPlaybackInfo": "View playback info",
Expand Down