-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate calendar events #446
Comments
Thanks for reporting this. Happened on my instance too, but I did not notice it. I will fix it. |
Blocked by SeaQL/sea-query#478 or SeaQL/sea-orm#1938. Note to self:
Create 2 partial indices:
If the above PR is not merged, I will have to go the hacky way of inserting an empty string into the metadata_extra_information for non shows/podcasts. This utility might be useful. |
@LnLcFlx This will likely take some time to be fixed since it depends on an upstream problem. For the time being, if it is really bothering you, you can run this SQL to remove duplicate elements. It worked on my instance, but make sure you backup your DB just in case. CREATE OR REPLACE FUNCTION process_event_ids() RETURNS VOID AS $$
DECLARE
rec record; id2 integer;
BEGIN
FOR rec IN
SELECT date, metadata_id, ARRAY_AGG(id) AS event_ids
FROM calendar_event
WHERE metadata_extra_information IS NULL
GROUP BY date, metadata_id
HAVING COUNT(*) > 1
LOOP
FOREACH id2 IN ARRAY rec.event_ids[2:]
LOOP
RAISE NOTICE 'Processing event_id %', id2;
DELETE FROM calendar_event where id = id2;
END LOOP;
END LOOP;
END;
$$ LANGUAGE plpgsql;
SELECT process_event_ids();
DROP FUNCTION process_event_ids; |
@LnLcFlx can you confirm if everything works as expected now? |
Prior to updating, I have deleted all duplicates using your SQL. |
After #426 was fixed, many duplicates of movie release dates started appearing. First some movies only had the same release date twice, then triple ...
I don't know if these are actually dates on TMDB or just the same redundant dates.
The text was updated successfully, but these errors were encountered: