Skip to content

Comments

Add thumbnail support#3

Merged
kheina merged 1 commit intomainfrom
add-thumbnail-table
Feb 15, 2025
Merged

Add thumbnail support#3
kheina merged 1 commit intomainfrom
add-thumbnail-table

Conversation

@kheina
Copy link
Contributor

@kheina kheina commented Jan 14, 2025

No description provided.

@github-actions
Copy link

github-actions bot commented Jan 14, 2025

PR Summary

This PR adds thumbnail support to the application. Changes include database schema updates to support thumbnails, modifications to various modules for thumbnail generation and handling, and updates to the Dockerfile and docker-compose file. Additionally, the FailedLogin exception was added to the authenticator module, and several other minor changes were made.

Changes

File Summary
Dockerfile Added ffmpeg for video processing and thumbnail generation. Removed unnecessary apt lists after update.
authenticator/authenticator.py Replaced Unauthorized exception with FailedLogin exception in multiple login and password change methods for better error handling.
configs/configs.py Added randrange import and modified getFunding to return a random value between 1000 and 1500 in local environment.
db/00/00-init.sql Removed extra newline characters and updated schema names to public where applicable. Improved formatting and readability.
db/07/01-post_media.sql Updated view names to public.internal_posts and function names to public.internal_posts_funcs for consistency.
db/07/02-immutable-cols.sql Added begin; and commit; statements, and set the schema to public.
db/07/03-drop-post-media-cols.sql Updated the procedure call to public.immutable_columns.
db/08/00-post-immutable-cols.sql Updated the procedure call to public.immutable_columns.
db/09/01-add-media-thumbnails.sql Added a new table thumbnails to store thumbnail information. Created views and functions for managing thumbnails. Updated internal_posts view to include thumbnails.
db/09/02-add-deleted-col-to-posts.sql Added a deleted column to the posts table to track deleted posts. Updated indexes and the internal_posts view.
db/09/03-add-system-tags.sql Added system tags for animated, video, and audio media types. Added a system user.
docker-compose.yml Updated the postgres image version from 13-alpine to 17-alpine.
emojis/emoji.py Minor code style changes.
emojis/repository.py Minor code style changes.
emojis/router.py Added an empty line.
init.py Added MimeType import from shared.backblaze. Modified uploadEmojis function to use MimeType.png and added progress bar.
makefile Added a dev target to start the application in development mode using docker compose and fastapi dev.
posts/models.py Added Thumbnail model, updated Media model to include thumbnails, and updated Post model to include tags and replies. Removed hardcoded CDN host.
posts/posts.py Updated _fetch_posts to handle tags more efficiently. Updated fetchPosts to handle tags and added fetchComments function. Updated getPost to fetch comments.
posts/readme.md Added ffmpeg to the list of requirements.
posts/repository.py Updated parse_response to handle thumbnails. Updated internal_select to include thumbnails. Added CteQuery function.
posts/router.py Updated route handlers to use new models and functions. Added new routes for video uploads.
posts/uploader.py Added functions for uploading videos and generating thumbnails. Updated uploadImage to handle thumbnails and system tags. Updated deletePost to handle unpublished posts.
requirements.lock Added aiofiles and python-ffmpeg to the requirements.
requirements.txt Added aiofiles and python-ffmpeg to the requirements.
sets/repository.py Updated authorized function to use privacy_map.get_id.
sets/sets.py Updated _validate_privacy function to use privacy_map.get_id.
shared/auth/__init__.py Removed extra newline characters.
shared/backblaze.py Added MimeType enum for easier mime type handling. Updated upload and upload_async functions to use MimeType.
.dockerignore Added videos to the list of ignored files.

autogenerated by presubmit.ai

@github-actions github-actions bot changed the title Storing Thumbnails in DB @presubmit Add thumbnail support Jan 14, 2025
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

LGTM!

Review Summary

Commits Considered (1)
Files Processed (29)
  • db/00/00-init.sql (32 hunks)
  • db/07/01-post_media.sql (3 hunks)
  • db/07/02-immutable-cols.sql (2 hunks)
  • db/07/03-drop-post-media-cols.sql (1 hunk)
  • db/08/00-post-immutable-cols.sql (1 hunk)
  • db/09/01-add-media-thumbnails.sql (1 hunk)
  • docker-compose.yml (1 hunk)
  • emojis/emoji.py (1 hunk)
  • emojis/repository.py (1 hunk)
  • emojis/router.py (1 hunk)
  • init.py (5 hunks)
  • posts/models.py (11 hunks)
  • posts/posts.py (18 hunks)
  • posts/repository.py (18 hunks)
  • posts/router.py (1 hunk)
  • posts/uploader.py (17 hunks)
  • sets/repository.py (1 hunk)
  • sets/sets.py (6 hunks)
  • shared/auth/init.py (1 hunk)
  • shared/logging.py (5 hunks)
  • shared/maps.py (1 hunk)
  • shared/models/_shared.py (1 hunk)
  • shared/sql/query.py (11 hunks)
  • shared/utilities/json.py (1 hunk)
  • tags/models.py (1 hunk)
  • tags/repository.py (2 hunks)
  • tags/tagger.py (7 hunks)
  • users/repository.py (1 hunk)
  • users/users.py (1 hunk)
Actionable Comments (0)
Skipped Comments (0)

@kheina kheina force-pushed the add-thumbnail-table branch from f8163fe to a970bca Compare February 15, 2025 19:47
@kheina kheina merged commit a970bca into main Feb 15, 2025
1 check failed
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.

1 participant