Commit Graph

10 Commits

Author SHA1 Message Date
Simone Robutti 7c5f263c2b
fixed teardown (#42) 2021-07-21 09:08:19 +02:00
Simone Robutti 9578f18078
first run (#36)
* added settings as CLI option

* added group missing error

* comments

* testing empty events

* fixed transaction

* main is working

* added logging and fixed publication

* refactored some publication code

* removed redundant field

* storage: query: Work around https://github.com/tortoise/tortoise-orm/issues/419 .

* storage: query: Update testing environment check.

* review

* tests: models: Test `MobilizonEvent.compute_status`.

Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2021-07-12 22:17:49 +02:00
tinoilcotechino 6cea51bcab
Publications (#28)
* mobilizon_bots: query: Add create_publisher.

* Move PublicationStatus to models.publication.

* Move NotificationStatus to models.notification.

* storage: query: Add events_with_status.

* storage: query: Add get_unpublished_events.

* storage: query: Add create_unpublished events.

This function takes care of looking into the database
to store only the events whose  is not
already present.

* event: event: Support multiple publications.

This patch changes the public interface of `MobilizonEvent` to
support multiple publications. This mainly entails two changes:

  - When instancing a `MobilizonEvent`  from an `Event` model
    the `publication_status` will be computed by looking at
    the statuses of all the related publications.
  - Now the `publication_time` is a `dict[str, Arrow]`. This
    enables tracking multiple social platforms publication time.

* Update main.

* Minor fixes

* Better definition of MobilizonEvent.publication_status.

Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2021-07-05 23:07:12 +02:00
Simone Robutti 891d523751
added CLI (#27) 2021-07-05 21:58:29 +02:00
Giacomo Leidi dd664089d8 main: Use get_published_events query. 2021-05-31 01:19:24 +02:00
tinoilcotechino c129edd1e5
Add models (#18) 2021-05-31 01:11:50 +02:00
Giacomo Leidi e51e8f160f :main: Gracefully tear down DB on exception. 2021-05-30 23:03:34 +02:00
Simone Robutti 0e236a4be3 added main loop stub 2021-05-13 13:32:56 +02:00
Simone Robutti 4f194ab01c added tests for strategy 2021-05-05 14:29:13 +02:00
Simone Robutti 6273e56311 restructured folders 2021-05-03 15:11:22 +02:00