001-1.1.6-0008-inotify-fix-SQL-error-when-moving-captions.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. From abc1972600d03d93e35fe30661f84a6ea52a058a Mon Sep 17 00:00:00 2001
  2. From: Justin Maggard <jmaggard@netgear.com>
  3. Date: Thu, 17 Mar 2016 13:37:09 -0700
  4. Subject: [PATCH] inotify: fix SQL error when moving captions
  5. Change INSERT to INSERT OR REPLACE when recording caption file moves,
  6. to avoid UNIQUE constraint failures.
  7. ---
  8. inotify.c | 3 +--
  9. metadata.c | 2 +-
  10. po/ru.po | 4 ++++
  11. 3 files changed, 6 insertions(+), 3 deletions(-)
  12. diff --git a/inotify.c b/inotify.c
  13. index c5c4343..88ca83a 100644
  14. --- a/inotify.c
  15. +++ b/inotify.c
  16. @@ -350,9 +350,8 @@ inotify_insert_file(char * name, const char * path)
  17. if( !is_image(path) )
  18. return -1;
  19. break;
  20. - default:
  21. + default:
  22. return -1;
  23. - break;
  24. }
  25. /* If it's already in the database and hasn't been modified, skip it. */
  26. diff --git a/metadata.c b/metadata.c
  27. index c08ca3f..2bfa8b9 100644
  28. --- a/metadata.c
  29. +++ b/metadata.c
  30. @@ -149,7 +149,7 @@ check_for_captions(const char *path, int64_t detailID)
  31. if (ret == 0)
  32. {
  33. - sql_exec(db, "INSERT into CAPTIONS"
  34. + sql_exec(db, "INSERT OR REPLACE into CAPTIONS"
  35. " (ID, PATH) "
  36. "VALUES"
  37. " (%lld, %Q)", detailID, file);
  38. diff --git a/po/ru.po b/po/ru.po
  39. index fda545d..e07502b 100644
  40. --- a/po/ru.po
  41. +++ b/po/ru.po
  42. @@ -85,6 +85,10 @@ msgstr "Папки"
  43. msgid "Playlists"
  44. msgstr "Списки Воспроизведения"
  45. +#: scanner.c:598
  46. +msgid "Recently Added"
  47. +msgstr ""
  48. +
  49. #: scanner.c:536
  50. msgid "Video"
  51. msgstr "Видео"
  52. --
  53. 2.11.0