Open u1-liquid opened 4 years ago
I will only be able to help in english, but feel free to ask if you have any question. You may encounter a similar issue with our Channel actors, since they have a list of URL too:
$ curl -k -L -H "Accept: application/activity+json" "https://channels.tests.funkwhale.audio/federation/actors/compositions" | jq
{
"id": "https://channels.tests.funkwhale.audio/federation/actors/compositions",
"outbox": "https://channels.tests.funkwhale.audio/federation/actors/compositions/outbox",
"inbox": "https://channels.tests.funkwhale.audio/federation/actors/compositions/inbox",
"preferredUsername": "compositions",
"type": "Person",
"name": "Compositions",
"followers": "https://channels.tests.funkwhale.audio/federation/actors/compositions/followers",
"following": "https://channels.tests.funkwhale.audio/federation/actors/compositions/following",
"manuallyApprovesFollowers": false,
"url": [
{
"type": "Link",
"href": "https://channels.tests.funkwhale.audio/channels/compositions",
"mediaType": "text/html"
},
{
"type": "Link",
"href": "https://channels.tests.funkwhale.audio/api/v1/channels/compositions/rss",
"mediaType": "application/rss+xml"
}
],
"icon": {
"type": "Image",
"url": "https://channels.tests.funkwhale.audio/media/attachments/75/b4/f1/nosmile.jpeg",
"mediaType": "image/jpeg"
},
"summary": "<p>I'm testing federation with the fediverse :)</p>",
"attributedTo": "https://channels.tests.funkwhale.audio/federation/actors/demo",
"category": "music",
"tag": [
{
"type": "Hashtag",
"name": "#funkwhale"
},
{
"type": "Hashtag",
"name": "#tests"
}
],
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
"https://funkwhale.audio/ns",
{
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"Hashtag": "as:Hashtag"
}
],
"publicKey": {
"owner": "https://channels.tests.funkwhale.audio/federation/actors/compositions",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv25u57oZfVLV3KltS+Hc\nsdSx9Op4MmzIes1J8Wu8s0KbdXf2zEwSsVqyHgs/XCbnzsR3FqyJTo46D2BVnvZc\nuU5srNcR2I2HMaqQ0oVdnATE4K6KdcgVN+98pMWo56B8LTgE1VpvqbsrXLi9jCTz\njrkebVMOP+ZVu+64v1qdgddseblYMnBZct0s7ONbHnqrWlTGf5wES1uIZTVdn5r4\nMduZG+Uenfi1opBS0lUUxfWdW9r0oF2byneZUyaUCbEroeKbqsweXCWVgnMarUOs\ngqC42KM4cf95lySSwTSaUtZYIbTw7s9W2jveU/rVg8BYZu5JK5obgBoxtlUeUoSs\nwwIDAQAB\n-----END PUBLIC KEY-----\n",
"id": "https://channels.tests.funkwhale.audio/federation/actors/compositions#main-key"
},
"endpoints": {
"sharedInbox": "https://channels.tests.funkwhale.audio/federation/shared/inbox"
}
}
(also, https://channels.tests.funkwhale.audio/ is a testing instance with the latest code changes. You can use it for all your Misskey federation tests, the login is demo
and the password is demo
).
url
は https://github.com/syuilo/misskey/pull/6234 で修正
@u1-liquid
あとFunkwhaleは固有実装したネームスペースファイルがあるようです https://funkwhale.audio/ns こっちもAPタイプに加えてよろしいでしょうか?(正攻法としてnをparseしたほうが良さそうだけど)
これは何を目的として何をすればいいです? AP typeを定義しても、DBに入れるところがないし、入れてもMisskeyに対応する機能がないです
ノート扱いでリンクが見れるだけでいいと思います。 いまは例のオブジェクトがあるURLを検索欄に入れるとなぜかエラーメッセージも出さず検索ダイアログごと閉じられる微妙な挙動になってるので、せめて照会だけはできるといいなという意見でした。
@u1-liquid
飛んでくるActivity / Outbox
type: Create
object:
type: Audio
単体のObject 参照
object:
type: Audio
みたいなNoteじゃなくてAudioみたいなObjectを、 今HubzillaのImage Objectでやってるように とりあえずリンクで参照できるようにする感じ?
そしてAudio以外には何があります?
https://funkwhale.audio/ns に定義されてますけど、 Audio以外は Album, Track, Artist, Library があり、 propertyとしてbitrateやartistsなどがありますね
実際のオブジェクトの例はこちらです Album https://sound.iro.moe/library/albums/21/ Track https://sound.iro.moe/library/tracks/1117/ Artist https://sound.iro.moe/library/artists/30/ Library https://sound.iro.moe/library/fc2f3ef1-4a0d-46ec-83d3-bbbdff78747f/
あっと、Audioは元々標準にあったのでサポートしてた。 Albumとかですね。
あっと、Audioは元々標準にあったのでサポートしてた。 Albumとかですね。
はい、Audioは今のところうまく連合されてますね。 (ここのIssueのOpen時のようにリンクがきちんと解釈されてない問題はもう修正済みなので)
Album:
AP Object: https://open.audio/federation/music/albums/44c22b44-15aa-4814-b31b-75d2df6f7068
artist: Artist[] を持ってる
tracks: Track[] とかありそうでない
Track: https://open.audio/federation/music/tracks/6dd075c7-4683-4d7b-bc7e-3863d7761755
artist: Artist[], album: Album を持ってる
Artist:
AP Object: https://open.audio/federation/music/artists/e1738258-e70c-4f2d-9e81-a1f8e1527d9a
albums: Album[], tracks: Track[], libraries: Library[] とかありそうでない (Webの方には該当する概念はある)
Library:
AP Object: https://open.audio/federation/music/libraries/28970d88-c672-4fa6-92dc-3672b73dd556
Collectionの継承みたいな感じ、itemsはAudioなど
※ current, last プロパティの値が間違ってる気がする
オブジェクトの下のつながりとか考えるとめんどくさそうだけど、 単純にNoteの亜種としてリンクするくらいなら大丈夫そう。
オブジェクトの下のつながりとか考えるとめんどくさそうだけど、
専用のUIを追加するほどでない限り(たぶんそれほどはいらない)オブジェクトの下の繋がりは無視してもいいかもしれませんね
単純にNoteの亜種としてリンクするくらいなら大丈夫そう。
はい、個人的には検索ボックスに入れてノートとして扱えるだけで十分だと思います。(引用リノートなどがしたいです)
Library以外はActor (User)に紐付いてないから、DB上でNoteにすることが出来ない…
Documentみたいに添付ファイル扱いにする? 添付ファイルもユーザーに紐付いてないと格納できない
Documentみたいに添付ファイル扱いにする? 添付ファイルもユーザーに紐付いてないと格納できない
アルバムとトラックには
"attributedTo":"https://sound.iro.moe/federation/actors/satsuki"
みたい感じのアップローダーのActorが載ってるので、その人の添付ファイル扱いにするとか…
アーティストは(まぁ人ですし)ユーザー扱いするのが当然かもですけど、なんか微妙ですね…
https://github.com/syuilo/misskey/issues/6231#issuecomment-616417404 の Album, Track は attributedTo: null だったりします
アーティストは(まぁ人ですし)ユーザー扱いするのが当然かもですけど、なんか微妙ですね…
鍵持ってたりActivity喋れるわけじゃないので Actor (IRemoteUser) じゃないんですよね。
curl -XGET -H "Accept: application/json" https://sound.iro.moe/api/v1/instance/nodeinfo/2.0 | jq -r '.metadata.actorId'
curl -XGET -H "Accept: application/json" https://sound.iro.moe/federation/actors/service | jq
AP上の処理はService actorを使う手もあるけど、特別扱いしなきゃならないし、悩ましい……。
そもそも Funkwhale 側でアーティストをActorにするべきな気がする (何も知らないのでもしかしたら検討違いなことを言ってるかもしれない)
なんも知らないからアレだけどこれMastodonはどう扱ってるんだろ
なんも知らないからアレだけどこれMastodonはどう扱ってるんだろ
Audio以外の Album, Track, Artist, Library は全部表示されないです
そもそもこれら (Album以下) はActivityとして飛んでくるわけではなく AP ObjectのURLを調べて直打ちしないと参照できないのではないかと思われるので 対応してなくても実影響ないのではと思います。
Summary
現状 https://iro.moe/notes/859gijxzpd
オブジェクト
今のところ、
url
に入ってる値はリンクテキストのみだという前提でparseしているようですが、 どうやらurl
は元から複数のオブジェクトも入れるみたいです https://www.w3.org/TR/activitystreams-vocabulary/#dfn-urlとりあえずこれに対応できればFunkwhaleの楽曲をノートとして受け取ることができそうですね
あとFunkwhaleは固有実装したネームスペースファイルがあるようです https://funkwhale.audio/ns
こっちもAPタイプに加えてよろしいでしょうか?(正攻法としてnをparseしたほうが良さそうだけど)