Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Playerctl module: Added extra metadata #191

Closed
wants to merge 4 commits into from

Conversation

Aproxia-dev
Copy link
Contributor

@Aproxia-dev Aproxia-dev commented Jan 18, 2023

I'll admit that the way i did it is not the greatest. I tried not to make it a breaking change.

An alternative solution would be giving access to metadata.value to the user directly, which would probably be a whole lot nicer and easier to implement than this load of crap as well.

@Aproxia-dev
Copy link
Contributor Author

Here's an example notification using said extra metadata.

image

And here's the code:

playerctl:connect_signal("metadata", function(_, title, artist, album_path, album, new, player_name, extra)
    if new == true then
        naughty.notify {
            title    = extra.track .. ". " .. artist .. " - " .. title,
            text     =  "from <b><i>" .. album .. "</i></b> (" .. extra.year .. ")",
            image    = album_path,
            app_name = player_name,
            app_icon = gc.recolor_image(icons.music, beautiful.notifs)
        }
    end
end)

@Nooo37 Nooo37 requested a review from Kasper24 January 20, 2023 21:01
@Kasper24
Copy link
Contributor

@javacafe01 Maybe we pass in a table instead of having so much values? We'll add it in a new signal for backwards compatibillity and keep the old one the same way

@javacafe01
Copy link
Member

@javacafe01 Maybe we pass in a table instead of having so much values? We'll add it in a new signal for backwards compatibillity and keep the old one the same way

Yup, that makes sense.

@Aproxia-dev
Copy link
Contributor Author

It definitely makes a lot of sense to make a new signal for it at this point. Passing so many values into a signal like that looks very silly. How should the new signal be called, though?

@javacafe01
Copy link
Member

It definitely makes a lot of sense to make a new signal for it at this point. Passing so many values into a signal like that looks very silly. How should the new signal be called, though?

The same. I mean, this is all metadata. Also, there should be some sort of checker that sees if the user is using the old method and notifies them.

@javacafe01
Copy link
Member

Ping @Aproxia-dev

1 similar comment
@javacafe01
Copy link
Member

Ping @Aproxia-dev

@Aproxia-dev
Copy link
Contributor Author

Closing this as I rewrote the whole thing and made a new PR. #207

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants