Skip to content

Commit

Permalink
chore: reduce tts length to 1000 (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwittstruck authored Sep 18, 2024
1 parent aa690a0 commit 391634a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/qrstorage/qr_codes/qr_code.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule Qrstorage.QrCodes.QrCode do

@dots_types ~w[dots square]a

@text_length_limits %{link: 1500, audio: 2000, text: 4000, recording: 1}
@text_length_limits %{link: 1500, audio: 1000, text: 4000, recording: 1}

@max_delete_after_year 9999
@valid_delete_after_months [0, 1, 24, 48]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule Qrstorage.Services.Translate.TranslateApiServiceImpl do
{:ok, translation}

{:error, message} ->
Logger.error("Error while translating text: #{:target_language} message: #{message}")
Logger.error("Error while translating text: #{target_language} message: #{message}")
{:error}
end
end
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Qrstorage.MixProject do
def project do
[
app: :qrstorage,
version: "0.4.1",
version: "0.4.2",
elixir: "~> 1.11",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down
8 changes: 4 additions & 4 deletions test/qrstorage/qr_codes_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ defmodule Qrstorage.QrCodesTest do
assert {:error, %Ecto.Changeset{}} = QrCodes.create_qr_code(invalid_link_attrs)
end

test "create_qr_code/1 with audio longer than 2000 returns error changeset" do
too_long = String.duplicate("a", 2001)
test "create_qr_code/1 with audio longer than 1000 returns error changeset" do
too_long = String.duplicate("a", 1001)

invalid_audio_attrs = %{
@valid_audio_attrs
Expand All @@ -137,8 +137,8 @@ defmodule Qrstorage.QrCodesTest do
assert {:error, %Ecto.Changeset{}} = QrCodes.create_qr_code(invalid_audio_attrs)
end

test "create_qr_code/1 with audio with length of 2000 returns ok" do
correct_length = String.duplicate("a", 2000)
test "create_qr_code/1 with audio with length of 1000 returns ok" do
correct_length = String.duplicate("a", 1000)

valid_audio_attrs = %{
@valid_audio_attrs
Expand Down

0 comments on commit 391634a

Please sign in to comment.