Skip to content

Commit

Permalink
General upgrade (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
brand-it authored Oct 4, 2024
1 parent 2dbd98a commit 4e32f84
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/services/create_mkv_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def video_blob
video: disk_title.video,
episode: disk_title.episode,
extra_type: :feature_films,
edition:
edition: edition.presence
)
else
VideoBlob.create!(
Expand Down
2 changes: 1 addition & 1 deletion current_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v5.1.0
v5.2.0
1 change: 0 additions & 1 deletion spec/factories/video_blobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
factory :video_blob do
video factory: %i[movie]
filename { 'Back to the Future Part III.mkv' }
sequence(:key) { "error-incidunt/#{_1}/perferendis-iure/Back to the Future Part III.mkv" }
content_type { 'video/x-matroska' }
byte_size { 123_456_789 }

Expand Down
2 changes: 1 addition & 1 deletion spec/models/video_blob_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
describe '#set_extra_type_number' do
context 'when using movies types' do
let!(:video_blob_a) { create(:video_blob, video: movie, extra_type: :feature_films) }
let!(:video_blob_b) { create(:video_blob, video: movie, extra_type: :feature_films) }
let!(:video_blob_b) { create(:video_blob, key: 'uniq', video: movie, extra_type: :feature_films) }
let(:movie) { create(:movie) }

it { expect(video_blob_a.extra_type_number).to be_nil }
Expand Down
15 changes: 15 additions & 0 deletions spec/services/create_mkv_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,20 @@
expect(call).to be_a(described_class::Result)
end
end

context 'when a video blob already exists' do
let(:service) { described_class.new(disk_title:, edition: '') }
let(:disk_title) { create(:disk_title, video: movie, episode: nil) }
let(:movie) { create(:movie) }

before do
allow(service).to receive(:cmd).and_return('ls /not-a-real-folder')
create(:video_blob, video: movie)
end

it 'responds with a result object' do
expect(call).to be_a(described_class::Result)
end
end
end
end

0 comments on commit 4e32f84

Please sign in to comment.