api service: add the ability to fetch a media-only timeline

This commit is contained in:
William Pitcock 2019-01-24 10:47:49 +00:00
parent 8197c77f75
commit dbe0205a9c

View file

@ -325,6 +325,7 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use
notifications: QVITTER_USER_NOTIFICATIONS_URL, notifications: QVITTER_USER_NOTIFICATIONS_URL,
'publicAndExternal': PUBLIC_AND_EXTERNAL_TIMELINE_URL, 'publicAndExternal': PUBLIC_AND_EXTERNAL_TIMELINE_URL,
user: QVITTER_USER_TIMELINE_URL, user: QVITTER_USER_TIMELINE_URL,
media: QVITTER_USER_TIMELINE_URL,
favorites: MASTODON_USER_FAVORITES_TIMELINE_URL, favorites: MASTODON_USER_FAVORITES_TIMELINE_URL,
tag: TAG_TIMELINE_URL tag: TAG_TIMELINE_URL
} }
@ -345,6 +346,9 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use
if (tag) { if (tag) {
url += `/${tag}.json` url += `/${tag}.json`
} }
if (timeline === 'media') {
params.push(['only_media', 1])
}
params.push(['count', 20]) params.push(['count', 20])