Progress on little important things
removing .mov for now until we can figure out solution with videojs, added model to track username changes, got chat creation flow down, progress on bookmark collections, albums, filtering blocks/mutes from group, explore, collection timelines
This commit is contained in:
18
app/models/account_username_change.rb
Normal file
18
app/models/account_username_change.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
# frozen_string_literal: true
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: account_username_changes
|
||||
#
|
||||
# id :bigint(8) not null, primary key
|
||||
# account_id :bigint(8) not null
|
||||
# from_username :text default(""), not null
|
||||
# to_username :text default(""), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
|
||||
class AccountUsernameChange < ApplicationRecord
|
||||
|
||||
belongs_to :account
|
||||
|
||||
end
|
||||
@@ -31,7 +31,8 @@ class Group < ApplicationRecord
|
||||
include GroupInteractions
|
||||
include GroupCoverImage
|
||||
|
||||
PER_ACCOUNT_LIMIT = 50
|
||||
PER_ACCOUNT_LIMIT_PRO = 100
|
||||
PER_ACCOUNT_LIMIT_NORMAL = 10
|
||||
|
||||
belongs_to :account, optional: true
|
||||
|
||||
@@ -53,7 +54,9 @@ class Group < ApplicationRecord
|
||||
validates :description, presence: true
|
||||
|
||||
validates_each :account_id, on: :create do |record, _attr, value|
|
||||
record.errors.add(:base, I18n.t('groups.errors.limit')) if Group.where(account_id: value).count >= PER_ACCOUNT_LIMIT
|
||||
account = Account.find(value)
|
||||
limit = account.is_pro ? PER_ACCOUNT_LIMIT_PRO : PER_ACCOUNT_LIMIT_NORMAL
|
||||
record.errors.add(:base, "You have reached the limit for group creation.") if Group.where(account_id: value).count >= limit
|
||||
end
|
||||
|
||||
before_save :set_slug
|
||||
|
||||
@@ -28,11 +28,11 @@ class MediaAttachment < ApplicationRecord
|
||||
enum type: [:image, :gifv, :video, :unknown]
|
||||
|
||||
IMAGE_FILE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif', '.webp'].freeze
|
||||
VIDEO_FILE_EXTENSIONS = ['.webm', '.mp4', '.m4v', '.mov'].freeze
|
||||
VIDEO_FILE_EXTENSIONS = ['.webm', '.mp4', '.m4v'].freeze
|
||||
|
||||
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze
|
||||
VIDEO_MIME_TYPES = ['video/webm', 'video/mp4', 'video/quicktime'].freeze
|
||||
VIDEO_CONVERTIBLE_MIME_TYPES = ['video/webm', 'video/quicktime'].freeze
|
||||
VIDEO_MIME_TYPES = ['video/webm', 'video/mp4'].freeze
|
||||
VIDEO_CONVERTIBLE_MIME_TYPES = ['video/webm'].freeze
|
||||
|
||||
BLURHASH_OPTIONS = {
|
||||
x_comp: 4,
|
||||
@@ -170,6 +170,7 @@ class MediaAttachment < ApplicationRecord
|
||||
elsif IMAGE_MIME_TYPES.include? f.instance.file_content_type
|
||||
IMAGE_STYLES
|
||||
elsif VIDEO_CONVERTIBLE_MIME_TYPES.include?(f.instance.file_content_type)
|
||||
puts "tilly convert"
|
||||
{
|
||||
small: VIDEO_STYLES[:small],
|
||||
original: VIDEO_FORMAT,
|
||||
|
||||
Reference in New Issue
Block a user