Files
jellyplist/templates/partials/_playlist_info.html
2024-12-17 17:45:06 +00:00

37 lines
1.4 KiB
HTML

<div class="d-flex align-items-center row sticky-top py-3 mb-3 bg-dark" style="top: 0; z-index: 1000;">
<div class="col-6">
<img src="{{ item.image }}" class="img-fluid">
</div>
<div class="col-6">
<div class="playlist-info">
<h1>{{ item.name }}</h1>
<p>{{ item.description }}</p>
<p>{{ item.track_count }} songs, {{ total_duration }}</p>
<p>Last Updated: {{ item.last_updated}} | Last Change: {{ item.last_changed}}</p>
{% include 'partials/_add_remove_button.html' %}
{% if session['is_admin'] and item.jellyfin_id %}
<p>
<button id="refresh-playlist-btn" class="btn btn-primary mt-2">Refresh Playlist in Jellyfin</button>
<script>
document.getElementById('refresh-playlist-btn').addEventListener('click', function() {
fetch(`/refresh_playlist/{{item.jellyfin_id}}`)
.then(response => response.json())
.then(data => {
if (data.success) {
alert('Playlist refreshed successfully');
} else {
alert('Failed to refresh playlist');
}
})
.catch(error => {
console.error('Error:', error);
alert('An error occurred while refreshing the playlist');
});
});
</script>
</p>
{% endif %}
</div>
</div>
</div>