Browse Source

Still not working update

pull/38/head
Dashie der otter 2 months ago
parent
commit
6a9cc8d59a
Signed by: Dashie <dashie@sigpipe.me> GPG Key ID: C2D57B325840B755
2 changed files with 8 additions and 1 deletions
  1. 1
    0
      models.py
  2. 7
    1
      tasks.py

+ 1
- 0
models.py View File

@@ -222,6 +222,7 @@ class Sound(db.Model):
album_id = db.Column(db.Integer(), db.ForeignKey("album.id"), nullable=True)
sound_infos = db.relationship("SoundInfo", backref="sound_info", lazy="dynamic", cascade="delete")
activity_id = db.Column(db.Integer(), db.ForeignKey("activity.id"), nullable=True)
activity = db.relationship("Activity")

timeline = db.relationship("Timeline", uselist=False, back_populates="sound")


+ 7
- 1
tasks.py View File

@@ -416,8 +416,14 @@ def send_update_sound(sound: Sound) -> None:
# FIXME: not sure at all about that
# Should not even work
actor = sound.user.actor[0]

# Fetch object and update fields
object = sound.activity.payload["object"]
object["name"] = sound.title
object["content"] = sound.description

raw_update = dict(
to=[follower.actor.url for follower in actor.followers], actor=actor.to_dict(), object=sound.activity.to_dict()
to=[follower.actor.url for follower in actor.followers], actor=actor.to_dict(), object=object
)
current_app.logger.debug(f"recipients: {raw_update['to']}")
update = ap.Update(**raw_update)

Loading…
Cancel
Save