Skip to content

Commit

Permalink
Fallback to use 'name' when there is no 'display' field information. …
Browse files Browse the repository at this point in the history
…Needed for old versions of OctoPrint that has an old API.

Closes #237
  • Loading branch information
gdombiak committed Jan 8, 2020
1 parent a5e71de commit 88b1ba9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
24 changes: 12 additions & 12 deletions OctoPod.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.9;
MARKETING_VERSION = 2.10;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "org.OctoPod.OctoPod.OctoPod-Widget";
Expand All @@ -1955,7 +1955,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.9;
MARKETING_VERSION = 2.10;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "org.OctoPod.OctoPod.OctoPod-Widget";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -1979,7 +1979,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.9;
MARKETING_VERSION = 2.10;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "org.OctoPod.OctoPod.OctoPod-Intent";
Expand All @@ -2004,7 +2004,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.9;
MARKETING_VERSION = 2.10;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "org.OctoPod.OctoPod.OctoPod-Intent";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -2148,7 +2148,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.9;
MARKETING_VERSION = 2.10;
PRODUCT_BUNDLE_IDENTIFIER = org.OctoPod.OctoPod;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -2172,7 +2172,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.9;
MARKETING_VERSION = 2.10;
PRODUCT_BUNDLE_IDENTIFIER = org.OctoPod.OctoPod;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -2190,7 +2190,7 @@
DEVELOPMENT_TEAM = ALV53VY374;
IBSC_MODULE = OctoPod_Watch_Extension;
INFOPLIST_FILE = "OctoPod Watch/Info.plist";
MARKETING_VERSION = 2.9;
MARKETING_VERSION = 2.10;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.OctoPod.OctoPod.watchkitapp;
Expand All @@ -2213,7 +2213,7 @@
DEVELOPMENT_TEAM = ALV53VY374;
IBSC_MODULE = OctoPod_Watch_Extension;
INFOPLIST_FILE = "OctoPod Watch/Info.plist";
MARKETING_VERSION = 2.9;
MARKETING_VERSION = 2.10;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.OctoPod.OctoPod.watchkitapp;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -2238,7 +2238,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.9;
MARKETING_VERSION = 2.10;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.OctoPod.OctoPod.watchkitapp.watchkitextension;
Expand All @@ -2264,7 +2264,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.9;
MARKETING_VERSION = 2.10;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.OctoPod.OctoPod.watchkitapp.watchkitextension;
PRODUCT_NAME = "${TARGET_NAME}";
Expand All @@ -2289,7 +2289,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.9;
MARKETING_VERSION = 2.10;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "org.OctoPod.OctoPod.OctoPod-Notification-Extension";
Expand All @@ -2313,7 +2313,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.9;
MARKETING_VERSION = 2.10;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "org.OctoPod.OctoPod.OctoPod-Notification-Extension";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
5 changes: 5 additions & 0 deletions OctoPod/Model/PrintFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -345,5 +345,10 @@ class PrintFile {
// Sort files by user prefered sort criteria
self.children = PrintFile.sort(files: newChildren, sortBy: nil)
}
// Check if there is no display information for the file and fallback to name
// This only happens with very old versions of OctoPrint like 1.3.4
if display == nil && name != nil {
display = name
}
}
}

0 comments on commit 88b1ba9

Please sign in to comment.