From eecc982073c83fc10688dca70c0223e17bf4c47b Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Sat, 14 Sep 2024 15:43:14 +0200 Subject: [PATCH] Bump versions and fix google filtering --- app/models/discourse_events/source.rb | 12 ++++++++++++ lib/discourse_events/import_manager.rb | 1 + plugin.rb | 6 +++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/models/discourse_events/source.rb b/app/models/discourse_events/source.rb index 5028af92..a2864aca 100644 --- a/app/models/discourse_events/source.rb +++ b/app/models/discourse_events/source.rb @@ -106,6 +106,18 @@ def to_time end end + def match_name + @match_name ||= + begin + filter = + filters.find_by( + query_column: DiscourseEvents::Filter.query_columns[:name], + query_operator: DiscourseEvents::Filter.query_operators[:like], + ) + filter ? filter.query_value : nil + end + end + private def valid_source_options? diff --git a/lib/discourse_events/import_manager.rb b/lib/discourse_events/import_manager.rb index a6764905..b97b97ba 100644 --- a/lib/discourse_events/import_manager.rb +++ b/lib/discourse_events/import_manager.rb @@ -71,6 +71,7 @@ def self.import(source) opts = source.source_options_with_fixed opts[:from_time] = source.from_time if source.from_time.present? opts[:to_time] = source.to_time if source.to_time.present? + opts[:match_name] = source.match_name if source.match_name.present? manager.import(opts) end diff --git a/plugin.rb b/plugin.rb index aa2fa143..1c00e376 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # name: discourse-events # about: Allows you to manage events in Discourse -# version: 0.8.5 +# version: 0.8.6 # authors: Angus McLeod # contact_emails: angus@pavilion.tech # url: https://github.com/paviliondev/discourse-events @@ -29,8 +29,8 @@ gem "omnievent-eventbrite", "0.1.0.pre2", require_name: "omnievent/eventbrite" gem "omnievent-eventzilla", "0.1.0.pre2", require_name: "omnievent/eventzilla" gem "omnievent-meetup", "0.1.0.pre1", require_name: "omnievent/meetup" -gem "omnievent-outlook", "0.1.0.pre6", require_name: "omnievent/outlook" -gem "omnievent-google", "0.1.0.pre3", require_name: "omnievent/google" +gem "omnievent-outlook", "0.1.0.pre7", require_name: "omnievent/outlook" +gem "omnievent-google", "0.1.0.pre4", require_name: "omnievent/google" Discourse.top_menu_items.push(:agenda) Discourse.anonymous_top_menu_items.push(:agenda)