Skip to content
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

Hide certain reminders from calendars in iOS #18568

Closed
microfx opened this issue Dec 26, 2019 · 19 comments
Closed

Hide certain reminders from calendars in iOS #18568

microfx opened this issue Dec 26, 2019 · 19 comments

Comments

@microfx
Copy link

microfx commented Dec 26, 2019

Hey!

I have tons of calendars and it's a mess in my reminder app on iOS - 99% of the reminders I don't want / need. Is there a way to disable them or is this too deeply in the CalDav protocol integrated?

There is a delete function which does this but the reminders reappear after a few seconds.

Merry xmas!

@BernieO
Copy link
Contributor

BernieO commented Dec 29, 2019

Are you talking about empty lists in reminders that are associated with a calendar and that are not needed as a reminder list?

@microfx
Copy link
Author

microfx commented Dec 29, 2019

exactly!

@BernieO
Copy link
Contributor

BernieO commented Dec 30, 2019

I don‘t think nextcloud has something built in to manage this.
As a workaround, you could disable the "reminder-ability" of the unneeded reminder-calendars in the database.

@microfx
Copy link
Author

microfx commented Dec 30, 2019

Could you guide me how to do this? Would it be time consuming to make this into a plugin?

@BernieO
Copy link
Contributor

BernieO commented Dec 30, 2019

Would it be time consuming to make this into a plugin?

I read a bit around and it seems very unlikely that this will be integrated in Nextcloud.
See:


Could you guide me how to do this?

Yes, but be aware that this might lead to undesired behaviour of the clients. I just tried it myself and didn't notice any problems with iOS/MacOS clients, though.

So, before you proceed, you should backup your calendars or backup the complete Nextcloud database.

You need to update field components from table [PREFIX]calendars to only contain VEVENT for the calendars you don't want to see anymore in the tasks app. Here is how this can be accomplished - do this on your own risk (I am assuming you know how to execute commands on your database, furthermore I assume that the table prefix is oc_):

  1. get id, displayname and components from all the calendars in the database:

    SELECT id, displayname, components FROM oc_calendars;
    

    Output should be something like:

    5 | Calendar-1 | VEVENT,VTODO
    6 | Calendar-2 | VEVENT,VTODO
    7 | Calendar-3 | VEVENT,VTODO
    
  2. replace XX with the ids of the to be removed task-lists in the following command:

    UPDATE oc_calendars SET components="VEVENT" WHERE id IN ('XX','XX','XX');
    

    e.g.:

    UPDATE oc_calendars SET components="VEVENT" WHERE id IN ('5','7');
    
  3. check the result in the database:

    SELECT id, displayname, components FROM oc_calendars;
    

    Output should be similar to (note that VTODO is missing for the desired calendars):

    5 | Calendar-1 | VEVENT
    6 | Calendar-2 | VEVENT,VTODO
    7 | Calendar-3 | VEVENT
    
  4. the changed task-list should now not be shown any longer in the Nextcloud tasks app or in the clients

  5. if something goes terribly wrong, restore the backup.


In my opinion this can be closed as this has been already extensively discussed in:

@microfx
Copy link
Author

microfx commented Dec 30, 2019

Thank you so much! To be honest I don't know how to execute commands in the database. A little hint would be nice - is it best with the occ cli in the shell or do I do it with some systemtools?

@BernieO
Copy link
Contributor

BernieO commented Dec 30, 2019

What kind of database are you using (sqlite3, MySQL, PostgreSQL)?

@microfx
Copy link
Author

microfx commented Dec 30, 2019

SQLite

@BernieO
Copy link
Contributor

BernieO commented Dec 30, 2019

  1. close this issue, as this is not an issue, but more a support and should not distract the developers trying to resolve open issues.

  2. Lookup datadirectory in /PATH/TO/NEXTCLOUD/config.php

  3. open the database with the sqlite-console

    sqlite3 /PATH/TO/DATADIRECTORY/owncloud.db
    
  4. issue the commands mentioned above

  5. to exit the SQLite3-console type .quit

@microfx microfx closed this as completed Dec 30, 2019
@microfx
Copy link
Author

microfx commented Dec 30, 2019

thank you so much - really appreciated! Wish you a great new year!!

@microfx
Copy link
Author

microfx commented Dec 31, 2019

@BernieO sadly I always get Error: file is encrypted or is not a database - searched the web but didn't find a solution I wanted to actually try - maybe I should upgrade to MySQL?

@BernieO
Copy link
Contributor

BernieO commented Dec 31, 2019

Are you sure you are trying to open the correct database?
Can you post the output of the following 3 commands?

grep datadir /PATH/TO/NEXTCLOUD/config/config.php
ls -l /PATH/TO/DATADIRECTORY
file /PATH/TO/DATADIRECTORY/owncloud.db

@microfx
Copy link
Author

microfx commented Dec 31, 2019

Thanks for your quick reply - here is the output

grep datadir config.php
  'datadirectory' => '/var/www/virtual/microfx/html/cloud/data',
ls -l /var/www/virtual/microfx/html/cloud/data

insgesamt 29260
drwxr-xr-x 11 microfx microfx     4096 19. Sep 15:19 appdata_o...
drwxr-xr-x  9 microfx microfx     4096 28. Dez 2017  appdata_ocj...
drwxr-xr-x  2 microfx microfx     4096 19. Dez 17:48 files_external
-rw-r--r--  1 microfx microfx        0 19. Dez 17:48 index.html
...personal...
-rw-r-----  1 microfx microfx 13473871 31. Dez 01:13 nextcloud.log
-rw-r--r--  1 microfx microfx 16324608 31. Dez 09:37 owncloud.db
drwxr-xr-x  5 microfx microfx     4096 16. Dez 2018  public
-rw-r--r--  1 microfx microfx    92145 19. Dez 17:48 updater.log
drwxr-xr-x  4 microfx microfx     4096 19. Dez 17:49 updater-oc6
file /var/www/virtual/microfx/html/cloud/data/owncloud.db 
/var/www/virtual/microfx/html/cloud/data/owncloud.db: SQLite 3.x database`

@BernieO
Copy link
Contributor

BernieO commented Dec 31, 2019

And issuing

sqlite3 /var/www/virtual/microfx/html/cloud/data/owncloud.db

results in:

Error: file is encrypted or is not a database

?

If yes: that doesn't look good.
I wonder though why Nextcloud still can access the database...

Can you try to dump the database with:

sqlite3 /var/www/virtual/microfx/html/cloud/data/owncloud.db .dump > db_dump.sql

Does this work? Or are there any error messages?

@microfx
Copy link
Author

microfx commented Dec 31, 2019

I am sorry I could have mentioned where exactly I get that message. It's in the console after I open the db with

sqlite3 /var/www/virtual/microfx/html/cloud/data/owncloud.db

and then in the console I type in your command to list the calendars and get that error.

That's the sql dump...

PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
COMMIT;

Guess I need to fix my db first... Maybe it's a good idea to use MySQL? Good question why it still works.

@BernieO
Copy link
Contributor

BernieO commented Dec 31, 2019

That's the sql dump...

PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
COMMIT;

Is that it? Only 3 lines??

@microfx
Copy link
Author

microfx commented Dec 31, 2019 via email

@BernieO
Copy link
Contributor

BernieO commented Dec 31, 2019

Guess I should convert it to MySQL first?

Yeah, why not. If Nextcloud is still working, the database conversion should work.

@microfx
Copy link
Author

microfx commented Dec 31, 2019 via email

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

No branches or pull requests

2 participants