@@ -2872,7 +2872,7 @@ def callback(self, data, callback_data):
2872
2872
# Adjust clip duration, start, and end
2873
2873
new_clip ["duration" ] = new_clip ["reader" ]["duration" ]
2874
2874
if file .data ["media_type" ] == "image" :
2875
- new_clip ["end" ] = self . settings_obj .get ("default-image-length" ) # default to 8 seconds
2875
+ new_clip ["end" ] = settings . get_settings () .get ("default-image-length" ) # default to 8 seconds
2876
2876
2877
2877
# Overwrite frame rate (incase the user changed it in the File Properties)
2878
2878
file_properties_fps = float (file .data ["fps" ]["num" ]) / float (file .data ["fps" ]["den" ])
@@ -3100,19 +3100,22 @@ def render_cache_json(self):
3100
3100
# Get final cache object from timeline
3101
3101
try :
3102
3102
cache_object = self .window .timeline_sync .timeline .GetCache ()
3103
- if cache_object and cache_object .Count () > 0 :
3104
- # Get the JSON from the cache object (i.e. which frames are cached)
3105
- cache_json = self .window .timeline_sync .timeline .GetCache ().Json ()
3106
- cache_dict = json .loads (cache_json )
3107
- cache_version = cache_dict ["version" ]
3108
-
3109
- if self .cache_renderer_version != cache_version :
3110
- # Cache has changed, re-render it
3111
- self .cache_renderer_version = cache_version
3112
- self .run_js (JS_SCOPE_SELECTOR + ".renderCache({});" .format (cache_json ))
3113
- finally :
3114
- # ignore any errors inside the cache rendering
3115
- pass
3103
+ if not cache_object or cache_object .Count () <= 0 :
3104
+ return
3105
+ # Get the JSON from the cache object (i.e. which frames are cached)
3106
+ cache_json = self .window .timeline_sync .timeline .GetCache ().Json ()
3107
+ cache_dict = json .loads (cache_json )
3108
+ cache_version = cache_dict ["version" ]
3109
+
3110
+ if self .cache_renderer_version == cache_version :
3111
+ # Nothing has changed, ignore
3112
+ return
3113
+ # Cache has changed, re-render it
3114
+ self .cache_renderer_version = cache_version
3115
+ self .run_js (JS_SCOPE_SELECTOR + ".renderCache({});" .format (cache_json ))
3116
+ except Exception as ex :
3117
+ # Log the exception and ignore
3118
+ log .warning ("Exception processing timeline cache: %s" , ex )
3116
3119
3117
3120
def __init__ (self , window ):
3118
3121
super ().__init__ ()
@@ -3123,8 +3126,7 @@ def __init__(self, window):
3123
3126
self .setAcceptDrops (True )
3124
3127
self .last_position_frames = None
3125
3128
3126
- # Get settings & logger
3127
- self .settings_obj = get_settings ()
3129
+ # Get logger
3128
3130
self .log_fn = log .log
3129
3131
3130
3132
# Add self as listener to project data updates (used to update the timeline)
@@ -3166,5 +3168,6 @@ def __init__(self, window):
3166
3168
# Connect shutdown signals
3167
3169
app .aboutToQuit .connect (self .redraw_audio_timer .stop )
3168
3170
app .aboutToQuit .connect (self .cache_renderer .stop )
3171
+
3169
3172
# Delay the start of cache rendering
3170
3173
QTimer .singleShot (1500 , self .cache_renderer .start )
0 commit comments