From: Michael Date: Sat, 23 Jul 2022 23:10:47 +0000 (+0000) Subject: Funkwhale context file moved X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=073695b33c5f9c5d89d91958b09259c59e12dd98;p=friendica.git Funkwhale context file moved --- diff --git a/funkwhale.audio.jsonld b/funkwhale.audio.jsonld deleted file mode 100644 index 75da1a870c..0000000000 --- a/funkwhale.audio.jsonld +++ /dev/null @@ -1,63 +0,0 @@ -{ - "@context": { - "id": "@id", - "type": "@type", - "as": "https://www.w3.org/ns/activitystreams#", - "schema": "http://schema.org#", - "fw": "https://funkwhale.audio/ns#", - "xsd": "http://www.w3.org/2001/XMLSchema#", - "Album": "fw:Album", - "Track": "fw:Track", - "Artist": "fw:Artist", - "Library": "fw:Library", - "bitrate": { - "@id": "fw:bitrate", - "@type": "xsd:nonNegativeInteger" - }, - "size": { - "@id": "fw:size", - "@type": "xsd:nonNegativeInteger" - }, - "position": { - "@id": "fw:position", - "@type": "xsd:nonNegativeInteger" - }, - "disc": { - "@id": "fw:disc", - "@type": "xsd:nonNegativeInteger" - }, - "library": { - "@id": "fw:library", - "@type": "@id" - }, - "track": { - "@id": "fw:track", - "@type": "@id" - }, - "cover": { - "@id": "fw:cover", - "@type": "as:Link" - }, - "album": { - "@id": "fw:album", - "@type": "@id" - }, - "artists": { - "@id": "fw:artists", - "@type": "@id", - "@container": "@list" - }, - "released": { - "@id": "fw:released", - "@type": "xsd:date" - }, - "musicbrainzId": "fw:musicbrainzId", - "license": { - "@id": "fw:license", - "@type": "@id" - }, - "copyright": "fw:copyright", - "category": "sc:category", - "language": "sc:inLanguage" - } -} diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 1a7458c0e4..aa169ab028 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -935,7 +935,7 @@ class Processor Logger::info('Item insertion successful', ['user' => $item['uid'], 'item_id' => $item_id]); $success = true; } else { - Logger::notice('Item insertion aborted', ['user' => $item['uid']]); + Logger::notice('Item insertion aborted', ['uri' => $item['uri'], 'uid' => $item['uid']]); } if ($item['uid'] == 0) { diff --git a/src/Protocol/ActivityPub/Queue.php b/src/Protocol/ActivityPub/Queue.php index 6d0bed3e1c..d150f9f9cc 100644 --- a/src/Protocol/ActivityPub/Queue.php +++ b/src/Protocol/ActivityPub/Queue.php @@ -179,7 +179,9 @@ class Queue */ public static function clear() { - DBA::delete('inbox-entry', ["`wid` IS NULL AND `received` < ?", DateTimeFormat::utc('now - 4 hours')]); + // We delete all entries that aren't associated with a worker entry after seven days. + // The other entries are deleted when the worker deferred for too long. + DBA::delete('inbox-entry', ["`wid` IS NULL AND `received` < ?", DateTimeFormat::utc('now - 7 days')]); } /** @@ -190,7 +192,7 @@ class Queue */ public static function processReplyByUri(string $uri) { - $entries = DBA::select('inbox-entry', ['id'], ['in-reply-to-id' => $uri], ['order' => ['id' => true]]); + $entries = DBA::select('inbox-entry', ['id'], ["`in-reply-to-id` = ? AND `object-id` != ?", $uri, $uri]); while ($entry = DBA::fetch($entries)) { self::process($entry['id']); } diff --git a/src/Worker/FetchMissingActivity.php b/src/Worker/FetchMissingActivity.php index 1a2818c3cc..6cb832c779 100644 --- a/src/Worker/FetchMissingActivity.php +++ b/src/Worker/FetchMissingActivity.php @@ -42,6 +42,7 @@ class FetchMissingActivity Queue::processReplyByUri($url); } elseif (!Worker::defer()) { Logger::info('Activity could not be fetched', ['url' => $url]); + // @todo performe recursive deletion of all entries } else { Logger::info('Fetching deferred', ['url' => $url]); } diff --git a/static/funkwhale.audio.jsonld b/static/funkwhale.audio.jsonld new file mode 100644 index 0000000000..75da1a870c --- /dev/null +++ b/static/funkwhale.audio.jsonld @@ -0,0 +1,63 @@ +{ + "@context": { + "id": "@id", + "type": "@type", + "as": "https://www.w3.org/ns/activitystreams#", + "schema": "http://schema.org#", + "fw": "https://funkwhale.audio/ns#", + "xsd": "http://www.w3.org/2001/XMLSchema#", + "Album": "fw:Album", + "Track": "fw:Track", + "Artist": "fw:Artist", + "Library": "fw:Library", + "bitrate": { + "@id": "fw:bitrate", + "@type": "xsd:nonNegativeInteger" + }, + "size": { + "@id": "fw:size", + "@type": "xsd:nonNegativeInteger" + }, + "position": { + "@id": "fw:position", + "@type": "xsd:nonNegativeInteger" + }, + "disc": { + "@id": "fw:disc", + "@type": "xsd:nonNegativeInteger" + }, + "library": { + "@id": "fw:library", + "@type": "@id" + }, + "track": { + "@id": "fw:track", + "@type": "@id" + }, + "cover": { + "@id": "fw:cover", + "@type": "as:Link" + }, + "album": { + "@id": "fw:album", + "@type": "@id" + }, + "artists": { + "@id": "fw:artists", + "@type": "@id", + "@container": "@list" + }, + "released": { + "@id": "fw:released", + "@type": "xsd:date" + }, + "musicbrainzId": "fw:musicbrainzId", + "license": { + "@id": "fw:license", + "@type": "@id" + }, + "copyright": "fw:copyright", + "category": "sc:category", + "language": "sc:inLanguage" + } +}