このコミットが含まれているのは:
2026-07-16 20:54:42 +09:00
コミット cde0a2deae
15個のファイルの変更490行の追加27行の削除
+6 -1
ファイルの表示
@@ -108,7 +108,12 @@ class PostMetadataFetcher
end
from = timestamp.change(sec: 0, nsec: 0)
before = from + 1.minute
before =
if match[5].nil?
from + 1.hour
else
from + 1.minute
end
[from, before]
end
+14
ファイルの表示
@@ -49,6 +49,20 @@ RSpec.describe PostMetadataFetcher do
expect(result.fetch(:original_created_from)).not_to include('.')
end
it 'treats hour-precision timestamps as one-hour ranges with and without offsets' do
offset_result = fetch_with_published_time('2024-02-03T12+02:30')
local_result = fetch_with_published_time('2024-02-03T12')
expect(Time.iso8601(offset_result.fetch(:original_created_from)))
.to eq(Time.iso8601('2024-02-03T12:00:00+02:30'))
expect(
Time.iso8601(offset_result.fetch(:original_created_before)) -
Time.iso8601(offset_result.fetch(:original_created_from))
).to eq(3600)
expect(local_result.fetch(:original_created_from)).to eq('2024-02-03T12:00:00Z')
expect(local_result.fetch(:original_created_before)).to eq('2024-02-03T13:00:00Z')
end
it 'adds platform tags for known video URLs' do
result = fetch_with_published_time('2024', url: 'https://youtu.be/abc123')