Skip to content

Commit

Permalink
Merge pull request #5556 from OpenShot/sentry-20240627
Browse files Browse the repository at this point in the history
Fixing many misc Sentry reports on OpenShot 3.2
  • Loading branch information
jonoomph authored Jul 1, 2024
2 parents 98d0ae3 + ada1d05 commit 9401749
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/classes/waveform.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def getAudioData(file, channel=-1, tid=None):
file = File.get(id=file_id)

# Only generate audio for readers that actually contain audio
if not file.data.get("has_audio", False):
if not file or not file.data.get("has_audio", False):
log.info("File does not have audio. Skipping")
return

Expand Down Expand Up @@ -163,6 +163,9 @@ def getAudioData(file, channel=-1, tid=None):
# Loop through samples from the file, applying this clip's volume curve
clip_audio_data = []
clip_instance = get_app().window.timeline_sync.timeline.GetClip(clip.id)
if not clip_instance:
log.info("Clip not found, bailing out of waveform volume adjustments")
continue
num_frames = clip_instance.info.video_length

# Determine best guess # of samples (based on duration)
Expand Down
5 changes: 5 additions & 0 deletions src/timeline/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,11 @@ App.controller("TimelineCtrl", function ($scope) {
* @return {string}
*/
$scope.getThumbPath = function (clip) {
if (!clip || !clip.reader) {
console.error("Invalid clip object or missing reader property in getThumbPath");
return "../images/NotFound.svg";
}

var has_video = clip["reader"]["has_video"];
var has_audio = clip["reader"]["has_audio"];
if (!has_video && has_audio) {
Expand Down
2 changes: 1 addition & 1 deletion src/windows/add_to_timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def accept(self):
# Add transition for this clip (if any)
# Open up QtImageReader for transition Image
if random_transition:
random_index = randint(0, len(self.transitions))
random_index = randint(0, len(self.transitions) - 1)
transition_path = self.transitions[random_index]

# Get reader for transition
Expand Down
2 changes: 1 addition & 1 deletion src/windows/models/properties_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
# Keyframe

# Protection from HUGE scale values
if property_key in ['scale_x', 'scale_y', 'shear_x', 'shear_y']:
if property_key in ['scale_x', 'scale_y', 'shear_x', 'shear_y'] and new_value:
width = get_app().project.get("width")
height = get_app().project.get("height")
is_svg = clip_data.get("reader", {}).get("path", "").lower().endswith("svg")
Expand Down
4 changes: 4 additions & 0 deletions src/windows/video_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,10 @@ def __init__(self, watch_project=True, *args):
self.leftHandle = None
self.rightHandle = None
self.centerHandle = None
self.topShearHandle = None
self.leftShearHandle = None
self.rightShearHandle = None
self.bottomShearHandle = None
self.clipBounds = None
self.originHandle = None
self.mouse_pressed = False
Expand Down

0 comments on commit 9401749

Please sign in to comment.