Comments (11)
That is not good!
When you were using 0.5, did you see any errors in the search results?
from notion-search-alfred-workflow.
Sounds like code not exiting a loop, perhaps due to this addition to the code
while True:
if (parent_table == "block"):
try:
stack.append(recordMap.get('block').get(id).get('value').get('properties').get('title')[0][0])
except:
pass
parent_table = recordMap.get('block').get(id).get('value').get('parent_table')
id = recordMap.get('block').get(id).get('value').get('parent_id')
if (parent_table == "collection"):
try:
stack.append(recordMap.get('collection').get(id).get('value').get('name')[0][0])
except:
pass
parent_table = recordMap.get('collection').get(id).get('value').get('parent_table')
id = recordMap.get('collection').get(id).get('value').get('parent_id')
if (parent_table == "space"):
break
from notion-search-alfred-workflow.
If the 100% CPU usage is reproducible, that would be very helpful to determine a fix.
from notion-search-alfred-workflow.
No I can't see any errors in the debug console. I've made a screen recording. It doesn't create multiple Python instances, just each time I search a new one will be created, but they all use around the 90% CPU.
from notion-search-alfred-workflow.
An easy fix will be to change the while true
loop to instead only loop 10 or 20 times, the logic builds the subtitle of the search result and aims to break out of the loop once it's traversed up the navigation tree. 10 should do, there are not many pages with more than 10 parent pages I'd say, and even if that was the case you wouldn't be able to fit more pages into the subtitle anyway.
To fix:
On line 207 change while True:
to
for x in range(10):
to notion.py in:
../Alfred Prefs/Alfred.alfredpreferences/workflows/user.workflow.0FA07E26-FD9B-49AD-B43E-B92E6C0D289E/
You might have a different user.worfklow folder, I'm not sure if that is the same for everyone.
from notion-search-alfred-workflow.
Would you mind changing that line in your code, keeping the indentation the same?
The change should be effective immediately, and some new notion searches will hopefully not cause 100% CPU.
IF I've found the problem.
from notion-search-alfred-workflow.
Just seen your video, I think that points towards the while true loop issue which is attempting to build the search subtitles.
Will be interesting to see what your subtitles look like after the fix above, I presume one or two results might be missing subtitles (bearing in mind pages at the top level, ie space level, do not have subtitles anyway)
from notion-search-alfred-workflow.
That fix seems to do the trick!
This is what my search result looks like.
from notion-search-alfred-workflow.
Ah good news! Thank you for testing and for raising this issue, I'll push a fix. The next time you load a search and hit enter it should update automatically.
For those currently experiencing this issue, hit enter in the ns workflow if you can, but you may need to update manually to the appropriate Alred4 or Alfred5 download as linked to here https://github.com/wrjlewis/notion-search-alfred-workflow
from notion-search-alfred-workflow.
Thanks for your support @mvaneijgen 🙌
I've pushed a fix now so you can download that manually (Alfred5), if it hasn't already automatically updated.
from notion-search-alfred-workflow.
You thanks for the support and the amazing work! 🎉
from notion-search-alfred-workflow.
Related Issues (20)
- Notion SVG icons are not displayed HOT 7
- Breadcrumb Separator HOT 1
- Not working in Alfred 5 Mac M1 HOT 8
- Having "In page" Notion Quick Search Option implemented into the Notion Search Alfred Workflow ? HOT 16
- The error "xcrun: error" is output HOT 2
- "notion search option" disappears from Alfred HOT 2
- SSL Certificate verify failed HOT 6
- Add Support to Open Search Results in New Window (Notion for MacOS) HOT 3
- "Payload" object has no attribute "pages" HOT 3
- Notion app does not launch since update HOT 6
- No result display and show back HOT 8
- Have tried all solutions discussed previously, SSL certificate issues still exist HOT 7
- The Alfred 5 download link is broken HOT 1
- Search result: 'Payload' object has no attribute 'results' HOT 4
- Keyword "Competitor" seem to break plugin HOT 4
- SVG Icons do not show: due to cairo libraries not found on apple silicon HOT 1
- Feature Request: 2 separate Alfred triggers to search Notion Page Title vs. Notion in-page
- WORK GR8! thanks! HOT 1
- Notion Search Issue on Alfred: Unable to Open Pages in Native App HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notion-search-alfred-workflow.