From 391634a147f8e1016fb08d93a29315b61b14c87c Mon Sep 17 00:00:00 2001
From: Nicholas <nwittstruck@users.noreply.github.com>
Date: Wed, 18 Sep 2024 13:05:37 +0200
Subject: [PATCH] chore: reduce tts length to 1000 (#342)

---
 lib/qrstorage/qr_codes/qr_code.ex                         | 2 +-
 .../services/translate/translate_api_service_impl.ex      | 2 +-
 mix.exs                                                   | 2 +-
 test/qrstorage/qr_codes_test.exs                          | 8 ++++----
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/qrstorage/qr_codes/qr_code.ex b/lib/qrstorage/qr_codes/qr_code.ex
index f2a0ee2..afd3e7d 100644
--- a/lib/qrstorage/qr_codes/qr_code.ex
+++ b/lib/qrstorage/qr_codes/qr_code.ex
@@ -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]
diff --git a/lib/qrstorage/services/translate/translate_api_service_impl.ex b/lib/qrstorage/services/translate/translate_api_service_impl.ex
index 9dd9dee..5b2224f 100644
--- a/lib/qrstorage/services/translate/translate_api_service_impl.ex
+++ b/lib/qrstorage/services/translate/translate_api_service_impl.ex
@@ -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
diff --git a/mix.exs b/mix.exs
index 84e177b..7a01aa1 100644
--- a/mix.exs
+++ b/mix.exs
@@ -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,
diff --git a/test/qrstorage/qr_codes_test.exs b/test/qrstorage/qr_codes_test.exs
index ef577b0..b8ed7a5 100644
--- a/test/qrstorage/qr_codes_test.exs
+++ b/test/qrstorage/qr_codes_test.exs
@@ -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
@@ -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