Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
narcolepsy and alcoholism :flag: (hj@shigusegubu.club)'s status on Wednesday, 29-Nov-2023 17:44:59 JSTnarcolepsy and alcoholism :flag: @NEETzsche @lain @Moon >This isn’t a bug. A bug is a scenario where it doesn’t work. Can you find one of those?
Here:
pleroma_dev=# SELECT data->>'object' FROM activities WHERE data->>'type' = 'Listen' ORDER BY inserted_at LIMIT 1;
?column?
----------------------------------------------------------------------
https://shitposter.club/objects/13ffa3ec-5114-425d-b6e6-a94091b8805c
(1 row)
So I search for the object
pleroma_dev=# SELECT data FROM objects WHERE data->>'id' = 'https://shitposter.club/objects/13ffa3ec-5114-425d-b6e6-a94091b8805c' ORDER BY inserted_at LIMIT 1;
and get basically this
{
"cc": ...,
"id": "https://shitposter.club/objects/13ffa3ec-5114-425d-b6e6-a94091b8805c",
"to": ...,
"bcc": ...,
"bto": ...,
"tag": ...,
"type": "Audio",
"actor": "https://shitposter.club/users/Moon",
"album": "Robotnik YouTube Poops",
"emoji": {},
"title": "Getaway Submarine",
"artist": "iteachvader",
"context": "https://shitposter.club/contexts/f45cab46-7de1-4386-a281-3bf5814f05c4",
"summary": "",
"published": "2023-11-12T22:19:16.655693Z",
"attachment": ...,
"attributedTo": "https://shitposter.club/users/Moon"
}
So I was wrong about it not being ingested, at least that is clear, however case for URLs and collision with actual Audio document still exists.
Let's query Audio documents
pleroma_dev=# SELECT data FROM objects WHERE data->>'type' = 'Audio' ORDER BY inserted_at LIMIT 1;
{
"cc": ...,
"id": "https://open.audio/federation/music/uploads/0ce93b9d-deb9-426a-86f5-cdf4b18dd42e",
"to": ...,
"bcc": ...,
"bto": ...,
"tag": ...,
"url": "https://open.audio/library/tracks/111688",
"name": "#25 Ende Gelände gegen Erdgas",
"type": "Audio",
"actor": "https://open.audio/federation/actors/endegelaende",
"emoji": {},
"likes": ...,
"content": "<p>Unter dem Motto \"Sauberes Erdgas ist eine dreckige Lüge\" ruft Ende Gelände vom 29.7. bis 2.8. zu Blockaden der Erdgasinfrastruktur in Brunsbüttel und Hamburg auf. Denn in Brunsbüttel soll ein neues LNG-Terminal gebaut werden, das wirklich niemand braucht, außer die fossile (Fracking-)Industrie und unser Lieblings-Sozi Olaf Scholz. Wir sprechen mit Fabian von der TU Berlin und Luisa von Ende Gelände über Erdgas, die geplante Aktion und was der Fokus Erdgas für Ende Gelände bedeutet.</p><p>Einige der Studien, die Fabian nennt, findet ihr hier zitiert: <a href=\"https://de.scientists4future.org/erdgas-brueckentechnologie-oder-risiko-fuer-die-energiewende/\">https://de.scientists4future.org/erdgas-brueckentechnologie-oder-risiko-fuer-die-energiewende/</a></p>",
"context": "https://shigusegubu.club/contexts/7bd1f36b-1d9e-4ad4-90b0-068f79b7929d",
"summary": "#anticapitalism #climate #coal #Ende #Gelände #justice #Klimagerechtigkeit #Kohle",
"inReplyTo": null,
"published": "2021-07-12T09:53:29.707409Z",
"sensitive": false,
"attachment": ...,
"context_id": 50727800,
"like_count": 0,
"attributedTo": "https://open.audio/federation/actors/endegelaende",
"announcements": ...,
"replies_count": 0,
"announcement_count": 1
}
So now if we merge your url MRs, if I submit a scrobble with url "https://open.audio/library/tracks/111688"
This query will yield two (or more) results:
SELECT data FROM objects WHERE data->>'type' = 'Audio' AND data->>'url' = 'https://open.audio/library/tracks/111688' ORDER BY inserted_at;
If it does not add duplicate entries with same URL then there should be a way to have a "placeholder" data that gets updated with "real" data, however as far as database is concerned neither of those are "fake" so you'll have somehow distinguish between real and fake, and hope that funkwhale doesn't add "title" property that will make real look like fake.
P.S. had to redact some of the JSON becase BBCode doesn't like it.