diff --git a/.vscode/settings.json b/.vscode/settings.json index d0bdf1f..6b6f97f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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": [ diff --git a/lib/mave_metrics/stats.ex b/lib/mave_metrics/stats.ex index e8f7bc5..d7fee03 100644 --- a/lib/mave_metrics/stats.ex +++ b/lib/mave_metrics/stats.ex @@ -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 ->