Skip to content
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

feeds: include videos in feeds #238

Merged
merged 3 commits into from
Feb 5, 2017
Merged

feeds: include videos in feeds #238

merged 3 commits into from
Feb 5, 2017

Conversation

jasuarez
Copy link
Contributor

@jasuarez jasuarez commented Feb 1, 2017

Include videos when generating the feeds, besides the images.

Also, both for videos and for images without EXIF, use file modification
time.

sigal/gallery.py Outdated
self.src_filename = filename
self.date = self._get_file_date() or None
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_get_file_date should always return a date, so the or None seems useless (and the same above).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right. I'll remove it.

images.sort(key=lambda im: im.date, reverse=True)
videos = [vid for album in gallery.albums.values()
for vid in album.videos if vid.date is not None]
medias = images + videos
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use directly album.medias. (album.images and album.videos are the filtered versions of the first one).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

@saimn
Copy link
Owner

saimn commented Feb 1, 2017

Thanks for working on this plugin @jasuarez ! I never really finished it so it is much appreciated.

Include videos when generating the feeds, besides the images.

Also, both for videos and for images without EXIF, use file modification
time.
We need to escape them to avoid end up in titles like "today & tomorrow"
instead of "today & tomorrow".
@saimn saimn merged commit ba18664 into saimn:master Feb 5, 2017
@saimn
Copy link
Owner

saimn commented Feb 5, 2017

Thanks @jasuarez !

@saimn saimn added this to the 1.4.0 milestone Feb 5, 2017
@jasuarez jasuarez deleted the feed-videos branch February 6, 2017 16:36
kontza pushed a commit to kontza/sigal that referenced this pull request Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants