insanum / gcalcli

Google Calendar Command Line Interface
MIT License
3.26k stars 308 forks source link

Use of summaryOverride #665

Open Ticonderoga opened 10 months ago

Ticonderoga commented 10 months ago

When you import a calendar via URL the summary becomes the URL. Therefore the summary could be very very long and selecting a calendar could be very difficult. As an example, have a look to my 'gcalcli list' (I changed some characters in the URL / summary for privacy)

reader https://sedna.univ-fcomte.fr/jsp/custom/ufc/cal.jsp?data=3aa9a3e78a816479e884e19af13f7ec19c20f9a1fddf3db8dec12168787682c7a48b18cffc861581bcd9d598770f80fbcb3ba2c5abc9faf33bd8d320b4228e360e73b116ba57d8d85ca13df7b8aa13992ac577d226868daa6af56688876af752974,1 reader https://sedna.univ-fcomte.fr/jsp/custom/ufc/cal.jsp?data=fc55570352851a5f98f78d9be02820689c20f9a1fddf3db8dec78797892c7a48b18cffc861581bcd9d598770f80fbcb3ba2c5abc9faf33bd8d320b4228e360e73b116ba57d8d85ca13df7b8aa13992ac577d226868daa6af56688876af752974,1

So in google you could rename your agenda but it seems that is not spotted by gcalcli. If I look into the code the calendar dictionary as a new attribute named "summaryOverride" which is not used when you select a specific calendar.

So I strongly suggest to do something similar to :

    if 'summaryOverride' in self_cal.keys() and cal_name.name == self_cal['summaryOverride']:
        matches = [self_cal]
        self_cal['colorSpec'] = cal_name.color
        break

and add this in gcal.py in the function _select_cals

Ticonderoga commented 7 months ago

Any comment ?