From 6901ad18a6b11634506364693a8b2c23b2921cfc Mon Sep 17 00:00:00 2001 From: Offray Date: Tue, 2 Apr 2024 08:33:39 -0500 Subject: [PATCH] Querying media links in custom fields. --- repository/TiddlyWiki/Tiddler.class.st | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/repository/TiddlyWiki/Tiddler.class.st b/repository/TiddlyWiki/Tiddler.class.st index 4937ce4..4ecfcae 100644 --- a/repository/TiddlyWiki/Tiddler.class.st +++ b/repository/TiddlyWiki/Tiddler.class.st @@ -170,6 +170,17 @@ Tiddler >> customFields [ ^ customFields ifNil: [ customFields := Dictionary new] ] +{ #category : #accessing } +Tiddler >> customFieldsWithMediaLinks [ + | response | + response := OrderedDictionary new. + self customFields keysAndValuesDo: [:k :v | + (v endsWithAnyOf: #('mp4' 'jpg' 'jpeg' 'png')) + ifTrue: [response at: k put: v ] + ]. + ^ response +] + { #category : #accessing } Tiddler >> deleteUid [ self customFields deleteKey: 'uid'.