mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Remove unused like/dislike handling in userdatabuttons.js
This commit is contained in:
parent
2ea82cdec4
commit
13f6e09bf2
1 changed files with 0 additions and 47 deletions
|
@ -9,8 +9,6 @@ import ServerConnections from '../ServerConnections';
|
||||||
|
|
||||||
const userDataMethods = {
|
const userDataMethods = {
|
||||||
markPlayed: markPlayed,
|
markPlayed: markPlayed,
|
||||||
markDislike: markDislike,
|
|
||||||
markLike: markLike,
|
|
||||||
markFavorite: markFavorite
|
markFavorite: markFavorite
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -138,40 +136,6 @@ function markFavorite(link) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function markLike(link) {
|
|
||||||
const id = link.getAttribute('data-itemid');
|
|
||||||
const serverId = link.getAttribute('data-serverid');
|
|
||||||
|
|
||||||
if (!link.classList.contains('btnUserDataOn')) {
|
|
||||||
likes(id, serverId, true);
|
|
||||||
|
|
||||||
link.classList.add('btnUserDataOn');
|
|
||||||
} else {
|
|
||||||
clearLike(id, serverId);
|
|
||||||
|
|
||||||
link.classList.remove('btnUserDataOn');
|
|
||||||
}
|
|
||||||
|
|
||||||
link.parentNode.querySelector('.btnDislike').classList.remove('btnUserDataOn');
|
|
||||||
}
|
|
||||||
|
|
||||||
function markDislike(link) {
|
|
||||||
const id = link.getAttribute('data-itemid');
|
|
||||||
const serverId = link.getAttribute('data-serverid');
|
|
||||||
|
|
||||||
if (!link.classList.contains('btnUserDataOn')) {
|
|
||||||
likes(id, serverId, false);
|
|
||||||
|
|
||||||
link.classList.add('btnUserDataOn');
|
|
||||||
} else {
|
|
||||||
clearLike(id, serverId);
|
|
||||||
|
|
||||||
link.classList.remove('btnUserDataOn');
|
|
||||||
}
|
|
||||||
|
|
||||||
link.parentNode.querySelector('.btnLike').classList.remove('btnUserDataOn');
|
|
||||||
}
|
|
||||||
|
|
||||||
function markPlayed(link) {
|
function markPlayed(link) {
|
||||||
const id = link.getAttribute('data-itemid');
|
const id = link.getAttribute('data-itemid');
|
||||||
const serverId = link.getAttribute('data-serverid');
|
const serverId = link.getAttribute('data-serverid');
|
||||||
|
@ -187,11 +151,6 @@ function markPlayed(link) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function likes(id, serverId, isLiked) {
|
|
||||||
const apiClient = ServerConnections.getApiClient(serverId);
|
|
||||||
return apiClient.updateUserItemRating(apiClient.getCurrentUserId(), id, isLiked);
|
|
||||||
}
|
|
||||||
|
|
||||||
function played(id, serverId, isPlayed) {
|
function played(id, serverId, isPlayed) {
|
||||||
const apiClient = ServerConnections.getApiClient(serverId);
|
const apiClient = ServerConnections.getApiClient(serverId);
|
||||||
|
|
||||||
|
@ -206,12 +165,6 @@ function favorite(id, serverId, isFavorite) {
|
||||||
return apiClient.updateFavoriteStatus(apiClient.getCurrentUserId(), id, isFavorite);
|
return apiClient.updateFavoriteStatus(apiClient.getCurrentUserId(), id, isFavorite);
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearLike(id, serverId) {
|
|
||||||
const apiClient = ServerConnections.getApiClient(serverId);
|
|
||||||
|
|
||||||
return apiClient.clearUserItemRating(apiClient.getCurrentUserId(), id);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
fill: fill,
|
fill: fill,
|
||||||
destroy: destroy,
|
destroy: destroy,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue