-
Notifications
You must be signed in to change notification settings - Fork 7
Rework of media importing to handle multiple images + video #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Note that Twitter converts animated GIFs to MP4s so they are handled as video.
Note that Twitter converts animated GIFs to MP4s so they are handled as video.
|
||
$post_id = $this->process_tweet($tweet, $this->post_author_id); | ||
|
||
update_post_meta($post_id, '_tweet_id', $tweet->id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was in process_media
for some reason. I've moved it here.
Actually... hold off on this. I want to add alt text to images if I can! Shouldn't take long. |
Actually - looks like alt text isn't in the export. So don't wait for that. I'll still try and make you a test import though. |
OK, here's a folder of test material. This includes:
It does not include a tweet with multiple videos, but there's no reason I can see that that wouldn't work as well. To test this you can just unzip this into the usual location in |
@shawnhooper any thoughts on merging in this? |
@timnolte I sure do! I just haven't had time to test it. I'll try to merge it this week. |
Resolves #17
This is a fairly major refactor of media handling. It enables:
It saves multiple media items using meta keys:
_tweet_media_x
_tweet_media_type_x
All media are added to the Tweet using
img
orvideo
tags.I've tried to keep to the filtering conventions you have used.
It attempts some optimisation by only updating the post once when processing media for a post, and by changing how files are looped through. Specifically:
I did not implement a
--import-media
flag - this can be done another time.I bumped the version number and updated the readme.txt
This now VERY NEARLY successfully processes my entire Tweet history and media. There is one media not found error. I've not investigated this yet.
I'll leave this with you for review. I shall attempt to provide a minimal subset of my import for testing purposes, if that's helpful? But it's too late to do that today.
Thanks! Hope you like the improvements!