[grilo-plugins/wip/mschraal/acoustid-empty-releasegroups] grl-acoustid: Do not count empty releasegroups



commit bda618e64813f75c5dc2a311cdf38279e0405e3a
Author: Marinus Schraal <mschraal gnome org>
Date:   Sat Feb 15 23:50:26 2020 +0100

    grl-acoustid: Do not count empty releasegroups

 src/lua-factory/sources/grl-acoustid.lua | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/lua-factory/sources/grl-acoustid.lua b/src/lua-factory/sources/grl-acoustid.lua
index 8090f3ad..36200833 100644
--- a/src/lua-factory/sources/grl-acoustid.lua
+++ b/src/lua-factory/sources/grl-acoustid.lua
@@ -104,7 +104,9 @@ function get_count(results)
     for _,result in ipairs(results) do
       if result.recordings and #result.recordings > 0 then
         for _,recording in ipairs(result.recordings) do
-          count = count + #recording.releasegroups
+          if recording.releasegroups ~= nil then
+            count = count + #recording.releasegroups
+          end
         end
       end
     end


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]