diff --git a/app/services/album_cover_service.rb b/app/services/album_cover_service.rb index ef6c6f614..9ad339e8b 100644 --- a/app/services/album_cover_service.rb +++ b/app/services/album_cover_service.rb @@ -1,6 +1,6 @@ require "mini_magick" -class AlbumCoverService < BaseService +class AlbumCoverService < ApplicationService param :show def call diff --git a/app/services/base_service.rb b/app/services/application_service.rb similarity index 75% rename from app/services/base_service.rb rename to app/services/application_service.rb index ac42f04a7..4b6d2bc6d 100644 --- a/app/services/base_service.rb +++ b/app/services/application_service.rb @@ -1,4 +1,4 @@ -class BaseService +class ApplicationService extend Dry::Initializer def self.call(...) diff --git a/app/services/bustout_tag_service.rb b/app/services/bustout_tag_service.rb index fd03a7d3e..a1ca2db3e 100644 --- a/app/services/bustout_tag_service.rb +++ b/app/services/bustout_tag_service.rb @@ -1,4 +1,4 @@ -class BustoutTagService < BaseService +class BustoutTagService < ApplicationService MIN_GAP = 100 param :show diff --git a/app/services/cover_art_image_service.rb b/app/services/cover_art_image_service.rb index fdc877a89..7a0d0d586 100644 --- a/app/services/cover_art_image_service.rb +++ b/app/services/cover_art_image_service.rb @@ -1,4 +1,4 @@ -class CoverArtImageService < BaseService +class CoverArtImageService < ApplicationService param :show option :dry_run, default: -> { false } diff --git a/app/services/cover_art_prompt_service.rb b/app/services/cover_art_prompt_service.rb index 2ad7b914a..50eb3a6cb 100644 --- a/app/services/cover_art_prompt_service.rb +++ b/app/services/cover_art_prompt_service.rb @@ -1,4 +1,4 @@ -class CoverArtPromptService < BaseService +class CoverArtPromptService < ApplicationService param :show HUES = %w[ diff --git a/app/services/debut_tag_service.rb b/app/services/debut_tag_service.rb index a9709014b..91c3ee23f 100644 --- a/app/services/debut_tag_service.rb +++ b/app/services/debut_tag_service.rb @@ -1,4 +1,4 @@ -class DebutTagService < BaseService +class DebutTagService < ApplicationService param :show def call diff --git a/app/services/gap_service.rb b/app/services/gap_service.rb index 29b07202e..de86a343f 100644 --- a/app/services/gap_service.rb +++ b/app/services/gap_service.rb @@ -1,4 +1,4 @@ -class GapService < BaseService +class GapService < ApplicationService param :show def call diff --git a/app/services/google_spreadsheet_fetcher.rb b/app/services/google_spreadsheet_fetcher.rb index d367b6b55..1cdb595f1 100644 --- a/app/services/google_spreadsheet_fetcher.rb +++ b/app/services/google_spreadsheet_fetcher.rb @@ -1,4 +1,4 @@ -class GoogleSpreadsheetFetcher < BaseService +class GoogleSpreadsheetFetcher < ApplicationService attr_reader :spreadsheet_id, :range, :has_headers OOB_URI = "urn:ietf:wg:oauth:2.0:oob".freeze diff --git a/app/services/id3_tag_service.rb b/app/services/id3_tag_service.rb index 29e947f50..4725dc43c 100644 --- a/app/services/id3_tag_service.rb +++ b/app/services/id3_tag_service.rb @@ -1,6 +1,6 @@ require "mp3info" -class Id3TagService < BaseService +class Id3TagService < ApplicationService param :track def call diff --git a/app/services/interactive_cover_art_service.rb b/app/services/interactive_cover_art_service.rb index 84bc10fd1..7d6fb587f 100644 --- a/app/services/interactive_cover_art_service.rb +++ b/app/services/interactive_cover_art_service.rb @@ -1,4 +1,4 @@ -class InteractiveCoverArtService < BaseService +class InteractiveCoverArtService < ApplicationService include ActionView::Helpers::TextHelper class InterruptError < StandardError; end diff --git a/app/services/jamcharts_importer.rb b/app/services/jamcharts_importer.rb index f2e598430..56e313ca5 100644 --- a/app/services/jamcharts_importer.rb +++ b/app/services/jamcharts_importer.rb @@ -1,4 +1,4 @@ -class JamchartsImporter < BaseService +class JamchartsImporter < ApplicationService include ActionView::Helpers::SanitizeHelper BASE_URL = "https://api.phish.net/v5".freeze diff --git a/app/services/meta_tag_service.rb b/app/services/meta_tag_service.rb index 00e926a92..a4e930e92 100644 --- a/app/services/meta_tag_service.rb +++ b/app/services/meta_tag_service.rb @@ -1,4 +1,4 @@ -class MetaTagService < BaseService +class MetaTagService < ApplicationService param :path TITLE_SUFFIX = " - #{App.app_name}" diff --git a/app/services/search_service.rb b/app/services/search_service.rb index 935b4eafc..0f5760efa 100644 --- a/app/services/search_service.rb +++ b/app/services/search_service.rb @@ -1,4 +1,4 @@ -class SearchService < BaseService +class SearchService < ApplicationService param :term param :scope, default: proc { "all" } diff --git a/app/services/track_slug_generator.rb b/app/services/track_slug_generator.rb index 6c1685701..f9e3ee1f3 100644 --- a/app/services/track_slug_generator.rb +++ b/app/services/track_slug_generator.rb @@ -1,4 +1,4 @@ -class TrackSlugGenerator < BaseService +class TrackSlugGenerator < ApplicationService param :track def call diff --git a/app/services/track_tag_sync_service.rb b/app/services/track_tag_sync_service.rb index 75cc57b08..f9cda69b2 100644 --- a/app/services/track_tag_sync_service.rb +++ b/app/services/track_tag_sync_service.rb @@ -1,6 +1,6 @@ require "csv" -class TrackTagSyncService < BaseService +class TrackTagSyncService < ApplicationService include ActionView::Helpers::SanitizeHelper attr_reader :track, :created_ids, :updated_ids, :missing_tracks diff --git a/app/services/user_jwt_service.rb b/app/services/user_jwt_service.rb index 0126b0aed..81567f0cb 100644 --- a/app/services/user_jwt_service.rb +++ b/app/services/user_jwt_service.rb @@ -1,4 +1,4 @@ -class UserJwtService < BaseService +class UserJwtService < ApplicationService param :user def call diff --git a/app/services/waveform_image_service.rb b/app/services/waveform_image_service.rb index a7fc350c6..673af08d8 100644 --- a/app/services/waveform_image_service.rb +++ b/app/services/waveform_image_service.rb @@ -1,4 +1,4 @@ -class WaveformImageService < BaseService +class WaveformImageService < ApplicationService param :track def call diff --git a/db/migrate/20241103223637_remove_shrine.rb b/db/migrate/20241103223637_remove_shrine.rb deleted file mode 100644 index 4f2825bcd..000000000 --- a/db/migrate/20241103223637_remove_shrine.rb +++ /dev/null @@ -1,6 +0,0 @@ -class RemoveShrine < ActiveRecord::Migration[7.2] - def change - remove_column :tracks, :audio_file_data, :text - remove_column :tracks, :waveform_png_data, :text - end -end diff --git a/db/schema.rb b/db/schema.rb index a573ac577..979871ead 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2024_11_03_223637) do +ActiveRecord::Schema[7.2].define(version: 2024_10_06_185101) do # These are extensions that must be enabled in order to support this database enable_extension "pg_stat_statements" enable_extension "plpgsql" @@ -252,6 +252,8 @@ t.string "slug", limit: 255, null: false t.integer "tags_count", default: 0 t.integer "jam_starts_at_second" + t.text "waveform_png_data" + t.text "audio_file_data" t.index ["jam_starts_at_second"], name: "index_tracks_on_jam_starts_at_second" t.index ["likes_count"], name: "index_tracks_on_likes_count" t.index ["show_id", "position"], name: "index_tracks_on_show_id_and_position", unique: true