Skip to content

Commit

Permalink
Recreate string for source_url
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvanleeuwen committed Jan 16, 2024
1 parent 6734ec0 commit 2e4d05f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"editor.formatOnType": true,
"editor.wordBasedSuggestions": false,
"editor.wordBasedSuggestions": "off",
"editor.trimAutoWhitespace": false,
"editor.acceptSuggestionOnEnter": "off",
"editor.codeActionsOnSave": [
Expand Down
7 changes: 6 additions & 1 deletion lib/mave_metrics/stats.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ defmodule MaveMetrics.Stats do

# returns existing videos that aren't part of that video
def find_or_create_video(source_url, identifier, metadata) do
source_url = source_url |> URI.parse() |> Map.take([:host, :path])
%{scheme: scheme, host: host, path: path} =
source_url
|> URI.parse()
|> Map.take([:scheme, :host, :path])

source_url = "#{scheme}://#{host}#{path}"

case get_by_source_url_and_identifier_and_metadata(source_url, identifier, metadata) do
%Video{id: _id} = video ->
Expand Down

0 comments on commit 2e4d05f

Please sign in to comment.