jumoog / intro-skipper

Fingerprint audio to automatically detect and skip intro/credit sequences in Jellyfin
https://discord.gg/AYZ7RJ3BuA
GNU General Public License v3.0
405 stars 22 forks source link

automatic skip only for Apps without Skip Button #208

Open jumoog opened 2 days ago

jumoog commented 2 days ago

206

JinglingB commented 2 days ago

Eh. The auto skip option is the only way to have this plugin work with Jellyfin for Kodi.

jumoog commented 2 days ago

Eh. The auto skip option is the only way to have this plugin work with Jellyfin for Kodi.

whats the ClientName? Already found it

JinglingB commented 2 days ago

Thanks. Sorry, I was modifying a plugin to dump the SessionInfo for something played by my Android TV device running Kodi.

I note that DeviceName is what I renamed my Kodi instance running on said device to via the Jellyfin admin web interface. Would looking at session.Client, which still reports "Kodi", be possible instead?

e: Thanks!

AbandonedCart commented 2 days ago

Why not future proof it? Android TV and Kodi can be your defaults and allow entry of user defined values. This also allows you to add new values in the future by simply updating a list.

jumoog commented 2 days ago

Good idea. I would go one step further and let the user choose the client from his known clients list.

jumoog commented 22 hours ago

PoC:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Drag and Drop Multiple Items</title>
    <style>
        .container {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 20px;
            margin-top: 50px;
        }
        ul {
            list-style-type: none;
            padding: 0;
            width: 200px;
            height: 300px;
            border: 1px solid #ccc;
            overflow-y: auto;
        }
        li {
            padding: 10px;
            cursor: pointer;
            border-bottom: 1px solid #ccc;
            user-select: none;
        }
        li:hover {
            background-color: #f0f0f0;
        }
        li.selected {
            background-color: #d0e0ff;
        }
    </style>
</head>
<body>

<div class="container">
    <ul id="leftList">
        <li draggable="true">Jellyfin Web</li>
        <li draggable="true">Jellyfin Android</li>
        <li draggable="true">Findroid</li>
        <li draggable="true">Jellyfin Media Player</li>
    </ul>
    <ul id="rightList">
        <li draggable="true">Android TV</li>
        <li draggable="true">Kodi</li>
    </ul>
</div>

<script>
    document.querySelectorAll('ul').forEach(list => {
        list.addEventListener('click', function(event) {
            if (event.target.tagName === 'LI') {
                event.target.classList.toggle('selected');
            }
        });

        list.addEventListener('dragstart', function(event) {
            if (event.target.tagName === 'LI') {
                const selectedItems = list.querySelectorAll('li.selected');
                if (!selectedItems.length) {
                    event.target.classList.add('selected');
                }
                event.dataTransfer.setData('text/plain', null);
            }
        });

        list.addEventListener('dragover', function(event) {
            event.preventDefault();
        });

        list.addEventListener('drop', function(event) {
            event.preventDefault();
            const selectedItems = document.querySelectorAll('.selected');
            selectedItems.forEach(item => {
                list.appendChild(item);
                item.classList.remove('selected');
            });
        });
    });

    document.querySelectorAll('li').forEach(item => {
        item.setAttribute('draggable', 'true');
    });
</script>

</body>
</html>
AbandonedCart commented 10 hours ago

Findroid uses the plugin API and displays a native button. (To avoid confusion later)