diff options
Diffstat (limited to 'js/main.js')
-rw-r--r-- | js/main.js | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -536,6 +536,7 @@ function getAlphabet(uid, row) { function displayAlphabet(data, row) { const availableAlphabet = data.MediaContainer.Directory; + if (data.MediaContainer.thumb.indexOf('show') > -1) { libraryType = "shows"; } else { libraryType = "movie"; } @@ -574,6 +575,20 @@ function displayAlphabet(data, row) { $(`#btn${availableAlphabet[i].title}`).prop("disabled", false); } } + + // Get the non-English characters + const nonEngChars = availableAlphabet.filter(entry => !entry.title.match(/[a-z#]/i)); + + // Remove all custom buttons after the Z + $('#btnZ').nextAll().remove(); + + if (nonEngChars.length > 0) { + // Add buttons for the non English characters + for (let j = 0; j < nonEngChars.length; j++) { + $('#alphabetGroup').append(`<button id="btn${nonEngChars[j].title}" type="button" class="btn btn-outline-dark" + onclick="getLibraryByLetter(this)">${nonEngChars[j].title}</button>`); + } + } } function getLibraryByLetter(element) { |