From 05f3cdf2961a23a8532c04fde6acd76628d581dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Enrique=20Garc=C3=ADa=20Dab=C3=B3?= Date: Tue, 19 Jul 2022 21:55:47 +0200 Subject: [PATCH] Fix deep diff comparison of GObjects --- sublime_music/ui/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sublime_music/ui/util.py b/sublime_music/ui/util.py index 1f929cb..156b5b7 100644 --- a/sublime_music/ui/util.py +++ b/sublime_music/ui/util.py @@ -20,6 +20,8 @@ from ..adapters import AdapterManager, CacheMissError, Result, SongCacheStatus from ..adapters.api_objects import Playlist, Song from ..config import AppConfiguration +deep_diff_exclude_regexp = re.compile(r"root\[\d+\]\.props") + def format_song_duration(duration_secs: Union[int, timedelta, None]) -> str: """ @@ -163,7 +165,7 @@ def diff_model_store(store_to_edit: Any, new_store: Iterable[Any]): """ old_store = store_to_edit[:] - diff = DeepDiff(old_store, new_store) + diff = DeepDiff(old_store, new_store, exclude_regex_paths=deep_diff_exclude_regexp) if diff == {}: return