Fixed filepath bug when parsing metadata (#118)

This commit is contained in:
Kieran
2024-03-25 17:20:29 -07:00
committed by GitHub
parent fe641cfc49
commit af803b7081
7 changed files with 9912 additions and 18 deletions
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -1513,7 +1513,7 @@
"url": "https://i.ytimg.com/vi_webp/ABC123/maxresdefault.webp",
"preference": 0,
"id": "41",
"filepath": "/app/tmp/videos/ABC123/Pinchflat Example Video-ABC123.webp"
"filepath": "/tmp/test/tmpfiles/Pinchflat Example Video-ABC123.webp"
}
],
"thumbnail": "https://i.ytimg.com/vi/ABC123/maxresdefault.jpg",
@@ -9769,7 +9769,7 @@
"release_git_head": "5498729c59b03a9511c64552da3ba2f802166f8d",
"repository": "yt-dlp/yt-dlp-nightly-builds"
},
"infojson_filename": "/app/tmp/videos/ABC123/Pinchflat Example Video-ABC123.info.json",
"infojson_filename": "/tmp/test/tmpfiles/Pinchflat Example Video-ABC123.info.json",
"__infojson_filename": "/app/tmp/videos/ABC123/Pinchflat Example Video-ABC123.info.json",
"__real_download": true,
"__files_to_merge": [
Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

+31 -8
View File
@@ -52,14 +52,7 @@ defmodule Pinchflat.MediaFixtures do
"#{:rand.uniform(1_000_000)}_media.mkv"
])
fixture_media_filepath =
Path.join([
File.cwd!(),
"test",
"support",
"files",
"media.mkv"
])
fixture_media_filepath = media_filepath_fixture()
:ok = File.mkdir_p(Path.dirname(stored_media_filepath))
:ok = File.cp(fixture_media_filepath, stored_media_filepath)
@@ -82,4 +75,34 @@ defmodule Pinchflat.MediaFixtures do
Phoenix.json_library().encode!(media_attributes)
end
def media_filepath_fixture do
Path.join([
File.cwd!(),
"test",
"support",
"files",
"media.mkv"
])
end
def thumbnail_filepath_fixture do
Path.join([
File.cwd!(),
"test",
"support",
"files",
"thumbnail.jpg"
])
end
def infojson_filepath_fixture do
Path.join([
File.cwd!(),
"test",
"support",
"files",
"example.info.json"
])
end
end