20 Commits
Author SHA1 Message Date
Damiano Galassi 9077b6d149 Bump version to 1.9.5 2026-10-05 08:56:50 +02:00
Damiano Galassi a3e15e725a Update Italian localization 2026-10-05 08:16:39 +02:00
Damiano Galassi 839b47cd9e Update NEWS 2026-10-05 08:09:19 +02:00
Damiano Galassi b58346eda7 Improve selection restoration 2026-10-05 08:07:52 +02:00
Damiano Galassi 4c7a26a175 Move the 4k checkbox to the metadata preferences panel 2026-10-05 08:07:14 +02:00
Brett Pynn 85854a2f06 Add preference to allow 4k hd video metadata auto detection (#164) 2026-10-05 07:57:25 +02:00
Damiano Galassi a3f73cf1f8 Add missing classes to actions decoder
Fix #163.
2026-10-03 20:23:18 +02:00
Damiano Galassi a7739840ee Improve TVDB tv series name match 2026-10-03 20:17:52 +02:00
Damiano Galassi d0cd519460 Improve track view selection after an import 2026-10-03 17:59:29 +02:00
Damiano Galassi 1040f0dab6 Switch to the appropriate view after an action 2026-10-03 17:52:22 +02:00
Damiano Galassi dfdffb9332 Better preserve the UI state after an undo 2026-10-03 17:20:42 +02:00
Damiano Galassi 530ea2ed20 Use the newer actions icon on macOS 26 and later 2026-10-03 14:06:24 +02:00
Damiano Galassi 23f683626d Improve tracks and chapters undo 2026-10-03 14:06:06 +02:00
Damiano Galassi 934ae63b95 Expand undo/redo to all the document UI 2026-10-03 11:49:04 +02:00
Damiano Galassi 1cb5fb59dc Remove the '…' at the end of the 'Load more artworks' button 2026-10-01 10:55:11 +02:00
Damiano Galassi 81d5f8902c Add artworks in a deterministic order 2026-10-01 10:54:42 +02:00
Brett Pynn a48cb77aac Strip leading zeroes while preserving a real numeric zero (for example, S00 specials). (#160)
I always forget the regex syntax, so I can't really review the changes, but if it works…
2026-10-01 08:08:49 +02:00
Damiano Galassi d930bdb0a6 Do not retrieve the iTunes Store artworks when using a different provider
The iTunes Store API seems quite broken lately, and it doesn't add anything of value
2026-09-30 18:01:34 +02:00
Damiano Galassi 8c0d366764 Increase the default metadata search sheet width 2026-09-30 17:22:04 +02:00
Damiano Galassi 33a7665c5a Order the top artworks to make to make the various size options easier to pick 2026-09-30 17:21:35 +02:00
33 changed files with 353 additions and 333 deletions

No files matched your search

+12 -12
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24127" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="25098" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24127"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="25098"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -25,7 +25,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="fCL-eV-Fib">
<rect key="frame" x="436" y="13" width="122" height="32"/>
<rect key="frame" x="440" y="20" width="111" height="24"/>
<buttonCell key="cell" type="push" title="Set as artwork" bezelStyle="rounded" alignment="center" enabled="NO" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="rMb-PC-yTA">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -38,7 +38,7 @@ DQ
</connections>
</button>
<slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="fMj-Ew-Qej">
<rect key="frame" x="449" y="48" width="104" height="20"/>
<rect key="frame" x="451" y="54" width="100" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="o7H-4a-ogx"/>
</constraints>
@@ -49,8 +49,8 @@ DQ
</connections>
</slider>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="iH5-SJ-sDV">
<rect key="frame" x="13" y="13" width="159" height="32"/>
<buttonCell key="cell" type="push" title="Load more artwork..." bezelStyle="rounded" alignment="center" enabled="NO" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="40h-Rv-m31">
<rect key="frame" x="20" y="20" width="145" height="24"/>
<buttonCell key="cell" type="push" title="Load more artworks" bezelStyle="rounded" alignment="center" enabled="NO" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="40h-Rv-m31">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent">l</string>
@@ -61,7 +61,7 @@ DQ
</connections>
</button>
<button horizontalHuggingPriority="249" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Zyu-WY-ltM">
<rect key="frame" x="371" y="13" width="67" height="32"/>
<rect key="frame" x="371" y="20" width="57" height="24"/>
<buttonCell key="cell" type="push" title="None" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="UDG-fN-bQH">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -74,13 +74,13 @@ Gw
</connections>
</button>
<scrollView wantsLayer="YES" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c0O-We-pZd">
<rect key="frame" x="20" y="74" width="531" height="461"/>
<rect key="frame" x="20" y="80" width="531" height="455"/>
<clipView key="contentView" id="cHe-z7-drT">
<rect key="frame" x="1" y="1" width="529" height="459"/>
<rect key="frame" x="1" y="1" width="529" height="453"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<collectionView selectable="YES" allowsMultipleSelection="YES" id="234-cJ-3Un" customClass="ArtworkCollectionView" customModule="Subler" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="529" height="459"/>
<rect key="frame" x="0.0" y="0.0" width="529" height="453"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumInteritemSpacing="10" minimumLineSpacing="10" id="lte-fF-bVi">
<size key="itemSize" width="154" height="194"/>
@@ -99,14 +99,14 @@ Gw
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="nbX-9d-w82">
<rect key="frame" x="486" y="1" width="16" height="457"/>
<rect key="frame" x="513" y="1" width="17" height="453"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<progressIndicator hidden="YES" wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="AYL-Jp-agY">
<rect key="frame" x="20" y="20" width="16" height="16"/>
</progressIndicator>
<textField hidden="YES" horizontalHuggingPriority="249" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NEi-uU-Lh7">
<textField hidden="YES" focusRingType="none" horizontalHuggingPriority="249" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NEi-uU-Lh7">
<rect key="frame" x="41" y="21" width="86" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Progress status" id="TbL-2H-ra9">
<font key="font" metaFont="smallSystem"/>
+4 -3
View File
@@ -186,7 +186,7 @@ final class ArtworkSelectorController: NSViewController, NSCollectionViewDataSou
view.wantsLayer = true
imageBrowser.register(ArtworkSelectorViewItem.self, forItemWithIdentifier: ArtworkSelectorController.itemView)
loadMoreArtworks(count: 8)
loadMoreArtworks(count: 11)
let type = metadata.mediaKind.description
@@ -245,7 +245,7 @@ final class ArtworkSelectorController: NSViewController, NSCollectionViewDataSou
imageBrowser.reloadItems(at: [indexPath])
}
imageBrowser.selectionIndexPaths = selectionIndexPaths
imageBrowser.selectionIndexPaths = selectionIndexPaths
}
private func selectArtwork(at index: Int) {
@@ -294,7 +294,8 @@ final class ArtworkSelectorController: NSViewController, NSCollectionViewDataSou
}
private func selectedArtworks() -> [ArtworkImageObject] {
return imageBrowser.selectionIndexPaths.map { artworks[$0.item] }
let indexes = imageBrowser.selectionIndexPaths.map { $0.item } .sorted()
return indexes.map { artworks[$0] }
}
// MARK - UI state
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24506" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="25098" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24506"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="25098"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -19,17 +19,17 @@
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="Hz6-mo-xeY">
<rect key="frame" x="0.0" y="0.0" width="642" height="497"/>
<rect key="frame" x="0.0" y="0.0" width="642" height="518"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1XK-zr-YdW">
<rect key="frame" x="166" y="142" width="456" height="311"/>
<rect key="frame" x="166" y="167" width="456" height="307"/>
<clipView key="contentView" id="mho-zw-2Ud">
<rect key="frame" x="1" y="1" width="454" height="309"/>
<rect key="frame" x="1" y="1" width="454" height="305"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" tableStyle="plain" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="REl-53-Sku" viewBased="YES" id="Tid-Rc-Ljr">
<rect key="frame" x="0.0" y="0.0" width="454" height="286"/>
<rect key="frame" x="0.0" y="0.0" width="454" height="282"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -139,7 +139,7 @@
</tableHeaderView>
</scrollView>
<tokenField focusRingType="none" verticalHuggingPriority="750" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Y15-gP-AOw">
<rect key="frame" x="18" y="67" width="606" height="15"/>
<rect key="frame" x="18" y="88" width="606" height="15"/>
<tokenFieldCell key="cell" selectable="YES" allowsUndo="NO" alignment="left" allowsEditingTextAttributes="YES" id="rG5-g2-YmU">
<font key="font" metaFont="cellTitle"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -151,7 +151,7 @@
</connections>
</tokenField>
<button toolTip="Remove selected item" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sd5-qb-K5v">
<rect key="frame" x="207" y="107" width="44" height="32"/>
<rect key="frame" x="229" y="135" width="38" height="24"/>
<buttonCell key="cell" type="push" bezelStyle="rounded" image="NSRemoveTemplate" imagePosition="only" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="9UV-xM-L5F">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -161,7 +161,7 @@
</connections>
</button>
<popUpButton toolTip="Add annotation" verticalHuggingPriority="249" horizontalCompressionResistancePriority="751" translatesAutoresizingMaskIntoConstraints="NO" id="Jdh-Cj-6ef">
<rect key="frame" x="163" y="110" width="53" height="25"/>
<rect key="frame" x="166" y="135" width="61" height="24"/>
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="center" lineBreakMode="truncatingTail" borderStyle="border" inset="2" pullsDown="YES" selectedItem="5wF-Yq-18d" id="Hfq-XE-kzZ">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="message"/>
@@ -178,13 +178,13 @@
</connections>
</popUpButton>
<scrollView autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h1q-Xr-y6R">
<rect key="frame" x="20" y="142" width="138" height="311"/>
<rect key="frame" x="20" y="167" width="138" height="307"/>
<clipView key="contentView" ambiguous="YES" id="KId-fX-q1q">
<rect key="frame" x="1" y="1" width="136" height="309"/>
<rect key="frame" x="1" y="1" width="136" height="305"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" ambiguous="YES" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" tableStyle="plain" columnReordering="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="Eh9-8P-dr0" viewBased="YES" id="nXW-oy-rtu">
<rect key="frame" x="0.0" y="0.0" width="136" height="286"/>
<rect key="frame" x="0.0" y="0.0" width="136" height="282"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -256,7 +256,7 @@
</tableHeaderView>
</scrollView>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8sr-aI-VZy">
<rect key="frame" x="18" y="90" width="606" height="16"/>
<rect key="frame" x="18" y="111" width="606" height="16"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Available values:" id="OYx-Dd-YIf">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -264,7 +264,7 @@
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="BkU-sx-jUf">
<rect key="frame" x="494" y="107" width="135" height="32"/>
<rect key="frame" x="498" y="135" width="124" height="24"/>
<buttonCell key="cell" type="push" title="Restore Defaults" bezelStyle="rounded" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="nBh-jv-KDG">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -277,7 +277,7 @@
</connections>
</button>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZpH-Zy-mAt">
<rect key="frame" x="18" y="461" width="323" height="16"/>
<rect key="frame" x="18" y="482" width="323" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Map the providers' metadata to the MP4 annotations" id="cUW-9F-EvO">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -285,7 +285,7 @@
</textFieldCell>
</textField>
<button horizontalHuggingPriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="ZMK-Xt-bJh">
<rect key="frame" x="18" y="42" width="173" height="18"/>
<rect key="frame" x="20" y="64" width="169" height="16"/>
<buttonCell key="cell" type="check" title="Keep empty annotations" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="7Ek-lI-5Lo">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -295,7 +295,7 @@
</connections>
</button>
<button horizontalHuggingPriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="SZd-pK-hWX">
<rect key="frame" x="18" y="20" width="210" height="18"/>
<rect key="frame" x="20" y="42" width="206" height="16"/>
<buttonCell key="cell" type="check" title="Overwrite existing annotations" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="7KC-Up-hGn">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -304,6 +304,16 @@
<binding destination="LQR-UU-5Gl" name="value" keyPath="values.SBMetadataOverwriteExistingAnnotations" id="gMZ-eG-GV4"/>
</connections>
</button>
<button toolTip="4K metadata may cause streaming issues with some Apple TV and iTunes configurations" translatesAutoresizingMaskIntoConstraints="NO" id="cEs-iS-fwI">
<rect key="frame" x="20" y="20" width="232" height="16"/>
<buttonCell key="cell" type="check" title="Autodetect 4K HD Video Metadata" bezelStyle="regularSquare" imagePosition="left" inset="2" id="vyR-ib-B9Q">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="LQR-UU-5Gl" name="value" keyPath="values.SBSet4KHDVideoMetadata" id="OKn-J3-W8a"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="SZd-pK-hWX" firstAttribute="leading" secondItem="ZMK-Xt-bJh" secondAttribute="leading" id="00b-Uc-cOS"/>
@@ -319,15 +329,16 @@
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ZMK-Xt-bJh" secondAttribute="trailing" constant="20" id="GLC-tk-eTl"/>
<constraint firstItem="8sr-aI-VZy" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" id="HFP-B1-ScR"/>
<constraint firstItem="h1q-Xr-y6R" firstAttribute="leading" secondItem="Y15-gP-AOw" secondAttribute="leading" id="HMX-Qb-8MC"/>
<constraint firstAttribute="bottom" secondItem="cEs-iS-fwI" secondAttribute="bottom" constant="20" symbolic="YES" id="HUg-bO-NbS"/>
<constraint firstItem="h1q-Xr-y6R" firstAttribute="centerY" secondItem="1XK-zr-YdW" secondAttribute="centerY" id="JHk-tE-xQI"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="SZd-pK-hWX" secondAttribute="trailing" constant="20" symbolic="YES" id="MBW-h8-eD8"/>
<constraint firstItem="Jdh-Cj-6ef" firstAttribute="top" secondItem="h1q-Xr-y6R" secondAttribute="bottom" constant="8" id="NcZ-Os-USj"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ZpH-Zy-mAt" secondAttribute="trailing" constant="20" symbolic="YES" id="P7f-Fl-xTL"/>
<constraint firstItem="h1q-Xr-y6R" firstAttribute="top" secondItem="ZpH-Zy-mAt" secondAttribute="bottom" constant="8" symbolic="YES" id="S2n-Cv-TwB"/>
<constraint firstAttribute="bottom" secondItem="SZd-pK-hWX" secondAttribute="bottom" constant="21" id="WKQ-4s-IWN"/>
<constraint firstItem="BkU-sx-jUf" firstAttribute="centerY" secondItem="sd5-qb-K5v" secondAttribute="centerY" id="ZWW-ZP-Xp1"/>
<constraint firstItem="BkU-sx-jUf" firstAttribute="trailing" secondItem="1XK-zr-YdW" secondAttribute="trailing" id="bp9-bU-BRc"/>
<constraint firstItem="1XK-zr-YdW" firstAttribute="leading" secondItem="h1q-Xr-y6R" secondAttribute="trailing" constant="8" symbolic="YES" id="cCT-Qp-Bxz"/>
<constraint firstItem="cEs-iS-fwI" firstAttribute="top" secondItem="SZd-pK-hWX" secondAttribute="bottom" constant="6" symbolic="YES" id="d8X-hu-sZn"/>
<constraint firstItem="Jdh-Cj-6ef" firstAttribute="top" secondItem="sd5-qb-K5v" secondAttribute="top" id="ewc-at-D5g"/>
<constraint firstItem="BkU-sx-jUf" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="fdW-8M-iew"/>
<constraint firstItem="8sr-aI-VZy" firstAttribute="top" secondItem="Jdh-Cj-6ef" secondAttribute="bottom" constant="8" id="gVT-X2-Zcu"/>
@@ -337,9 +348,11 @@
<constraint firstItem="Y15-gP-AOw" firstAttribute="trailing" secondItem="8sr-aI-VZy" secondAttribute="trailing" id="mXF-1R-Sbp"/>
<constraint firstItem="ZpH-Zy-mAt" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="ttK-B9-wyu"/>
<constraint firstItem="sd5-qb-K5v" firstAttribute="leading" secondItem="Jdh-Cj-6ef" secondAttribute="trailing" constant="2" id="vIk-e5-WB3"/>
<constraint firstItem="cEs-iS-fwI" firstAttribute="leading" secondItem="SZd-pK-hWX" secondAttribute="leading" id="wdD-k6-Agx"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="cEs-iS-fwI" secondAttribute="trailing" constant="20" symbolic="YES" id="we6-QF-WHA"/>
<constraint firstItem="1XK-zr-YdW" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="166" id="yZg-V9-bxH"/>
</constraints>
<point key="canvasLocation" x="-296" y="-469.5"/>
<point key="canvasLocation" x="-296" y="-459"/>
</customView>
<arrayController objectClassName="NSString" id="RId-BH-Y2G" userLabel="Types Controller">
<classReference key="objectClass" className="NSString"/>
+7
View File
@@ -22,6 +22,7 @@ final class Document: NSDocument {
self.unsupportedMp4Brand = false
self.mp4 = MP42File()
super.init()
self.mp4.undo = undoManager
}
init(mp4: MP42File) {
@@ -37,6 +38,7 @@ final class Document: NSDocument {
} else {
updateChangeCount(.changeDone)
}
self.mp4.undo = undoManager
}
override func makeWindowControllers() {
@@ -60,6 +62,7 @@ final class Document: NSDocument {
override func read(from url: URL, ofType typeName: String) throws {
do {
mp4 = try MP42File(url: url)
mp4.undo = undoManager
} catch {
unsupportedMp4Brand = true
}
@@ -67,9 +70,11 @@ final class Document: NSDocument {
override func revert(toContentsOf url: URL, ofType typeName: String) throws {
mp4 = try MP42File(url: url)
mp4.undo = undoManager
if let docController = windowControllers.first as? DocumentWindowController {
docController.reloadData()
undoManager?.removeAllActions()
}
updateChangeCount(.changeCleared)
@@ -124,6 +129,8 @@ final class Document: NSDocument {
do {
let reloadedFile = try MP42File(url: url)
self.mp4 = reloadedFile
self.mp4.undo = self.undoManager
self.undoManager?.removeAllActions()
docController?.reloadData()
completionHandler(error)
} catch {
+59 -32
View File
@@ -9,7 +9,7 @@ import Cocoa
import MP42Foundation
import UniformTypeIdentifiers
final class DocumentWindowController: NSWindowController, TracksViewControllerDelegate, MetadataSearchViewControllerDelegate, ChapterSearchControllerDelegate, FileImportControllerDelegate, ProgressViewControllerDelegate, NSDraggingDestination, NSUserInterfaceValidations {
final class DocumentWindowController: NSWindowController, NSWindowDelegate, TracksViewControllerDelegate, MetadataSearchViewControllerDelegate, ChapterSearchControllerDelegate, FileImportControllerDelegate, ProgressViewControllerDelegate, NSDraggingDestination, NSUserInterfaceValidations {
private var doc: Document {
return document as! Document
@@ -73,6 +73,21 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
}
didSelect(tracks: [])
let update: (Notification) -> Void = { [weak self] notification in
guard let s = self else { return }
s.reloadDataAfterAnUndo()
}
NotificationCenter.default.addObserver(forName: NSNotification.Name.NSUndoManagerDidUndoChange,
object: doc.undoManager,
queue: OperationQueue.main,
using: update)
NotificationCenter.default.addObserver(forName: NSNotification.Name.NSUndoManagerDidRedoChange,
object: doc.undoManager,
queue: OperationQueue.main,
using: update)
}
private static let splitViewResorationIdentifier = NSUserInterfaceItemIdentifier(rawValue: "splitViewSave")
@@ -128,16 +143,20 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
}
private func clearDetailsViewControllers() {
saveTabIndex(metadataViewController)
saveTabIndexes()
metadataViewController = nil
saveTabIndex(videoViewController)
videoViewController = nil
saveTabIndex(soundViewController)
soundViewController = nil
chapterViewController = nil
multiViewController = nil
}
private func saveTabIndexes() {
saveTabIndex(metadataViewController)
saveTabIndex(videoViewController)
saveTabIndex(soundViewController)
}
private func detailsViewController(_ tracks: [MP42Track]) -> PropertyView {
if tracks.count > 1 {
let controller = MultiSelectViewController(numberOfTracks: UInt(tracks.count))
@@ -176,7 +195,10 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
return emptyViewController!
default:
if metadataViewController == nil {
if let metadataViewController = metadataViewController {
metadataViewController.metadata = mp4.metadata
}
else {
metadataViewController = MovieViewController(mp4: mp4, metadata: mp4.metadata)
}
return metadataViewController!
@@ -189,12 +211,20 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
tracksViewController.mp4 = doc.mp4
}
func reloadDataAfterAnUndo() {
let firstResponder = self.window?.firstResponder;
saveTabIndexes()
tracksViewController.reloadData()
if let firstResponder = firstResponder as? NSView, firstResponder.window != nil {
self.window?.makeFirstResponder(firstResponder)
}
}
// MARK: Tracks controller delegate
func didSelect(tracks: [MP42Track]) {
let detailsItem = splitViewController.splitViewItems[1]
if let detailsViewController = detailsItem.viewController.children.first {
doc.undoManager?.removeAllActions(withTarget: detailsViewController)
detailsViewController.view.removeFromSuperviewWithoutNeedingDisplay()
detailsItem.viewController.removeChild(at: 0)
}
@@ -215,7 +245,6 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
if Prefs.organizeAlternateGroups { mp4.organizeAlternateGroups() }
if Prefs.inferMediaCharacteristics { mp4.inferMediaCharacteristics() }
doc.updateChangeCount(.changeDone)
tracksViewController.reloadData()
}
}
@@ -322,8 +351,8 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
track.addChapter("Chapter 1", timestamp: 0)
}
doc.updateChangeCount(.changeDone)
tracksViewController.reloadData()
tracksViewController.selectTracks([track])
}
@IBAction func iTunesFriendlyTrackGroups(_ sender: Any) {
@@ -331,7 +360,6 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
mp4.inferTracksLanguages()
mp4.inferMediaCharacteristics()
doc.updateChangeCount(.changeDone)
tracksViewController.reloadData()
}
@@ -340,7 +368,6 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
track.name = ""
}
doc.updateChangeCount(.changeDone)
tracksViewController.reloadData()
}
@@ -350,13 +377,11 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
track.name = track.prettyTrackName
}
doc.updateChangeCount(.changeDone)
tracksViewController.reloadData()
}
@IBAction func fixAudioFallbacks(_ sender: Any) {
mp4.setAutoFallback()
doc.updateChangeCount(.changeDone)
tracksViewController.reloadData()
}
@@ -417,8 +442,8 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
mp4.metadata.addItem(MP42MetadataItem(identifier: MP42MetadataKeyHDVideo, value: NSNumber(value: hdType.rawValue),
dataType: .integer, extendedLanguageTag: nil))
}
doc.updateChangeCount(.changeDone)
metadataViewController?.metadata = mp4.metadata
tracksViewController.selectTracks([])
}
@IBAction func searchChapters(_ sender: Any?) {
@@ -432,31 +457,31 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
}
func didSelect(chapters: [MP42TextSample]) {
let chapterTrack = MP42ChapterTrack()
for chapter in chapters {
chapterTrack.addChapter(chapter)
}
let chapterTrack = MP42ChapterTrack()
for chapter in chapters {
chapterTrack.addChapter(chapter)
}
mp4.addTrack(chapterTrack)
doc.updateChangeCount(.changeDone)
tracksViewController.reloadData()
}
mp4.addTrack(chapterTrack)
tracksViewController.reloadData()
tracksViewController.selectTracks([chapterTrack])
}
// MARK: File import
private func addChapters(fileURL: URL) {
mp4.addTrack(MP42ChapterTrack(fromFile: fileURL))
doc.updateChangeCount(.changeDone)
let track = MP42ChapterTrack(fromFile: fileURL)
mp4.addTrack(track)
tracksViewController.reloadData()
tracksViewController.selectTracks([track])
}
private func updateChapters(fileURL: URL) {
do {
try mp4.chapters?.update(fromCSVFile: fileURL)
doc.updateChangeCount(.changeDone)
if let track = mp4.chapters {
chapterViewController?.track = track
tracksViewController.selectTracks([track])
}
}
catch {
@@ -472,12 +497,12 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
let ext = fileURL.pathExtension.lowercased()
if ext == "xml" || ext == "nfo", let metadata = MP42Metadata(url: fileURL) {
mp4.metadata.merge(metadata, overwrite: true)
doc.updateChangeCount(.changeDone)
metadataViewController?.metadata = mp4.metadata
tracksViewController.selectTracks([])
} else if let file = try? MP42File(url: fileURL) {
mp4.metadata.merge(file.metadata, overwrite: true)
doc.updateChangeCount(.changeDone)
metadataViewController?.metadata = mp4.metadata
tracksViewController.selectTracks([])
}
}
@@ -574,8 +599,6 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
}
if tracks.isEmpty == false {
doc.updateChangeCount(.changeDone)
if Prefs.organizeAlternateGroups {
mp4.organizeAlternateGroups()
if Prefs.inferMediaCharacteristics {
@@ -585,13 +608,17 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
}
}
if let metadata = metadata {
if let metadata, metadata.items.isEmpty == false {
mp4.metadata.merge(metadata, overwrite: true)
doc.updateChangeCount(.changeDone)
metadataViewController?.metadata = mp4.metadata
}
tracksViewController.reloadData()
if let metadata, metadata.items.isEmpty == false {
tracksViewController.selectTracks([])
} else if tracks.isEmpty == false {
tracksViewController.selectTracks(tracks)
}
}
// MARK: Drag & drop
+1 -1
View File
@@ -27,7 +27,7 @@ extension MP42File {
var hdType: TrackHDType? {
for track in tracks(withMediaType: kMP42MediaType_Video) as! [MP42VideoTrack] {
if (track.width > 1920 && track.height > 1088) {
return nil // .hd4k 4k breaks AppleTV streaming
return Prefs.set4KHDVideoMetadata ? .hd4k : nil
} else if (track.width > 1280 || track.height > 720) && track.width <= 1920 && track.height <= 1088 {
return .hd1080p
} else if track.width >= 960 && track.height >= 720 || track.width >= 1280 {
+29 -8
View File
@@ -66,6 +66,7 @@ private extension MetadataResult {
}
self.remoteArtworks = [item.images.coverArt16X9, item.images.coverArt].compactMap { $0?.artwork(type: .poster) }
self.remoteArtworks += [item.images.previewFrame].compactMap { $0?.artwork(type: .backdrop) }
self.remoteArtworks += [episode.seasonImages.coverArt16X9, episode.seasonImages.coverArt].compactMap { $0?.artwork(type: .season) }
self.remoteArtworks += [episode.images.previewFrame].compactMap { $0?.artwork(type: .episode) }
}
@@ -163,9 +164,14 @@ public struct AppleTV: MetadataService {
if let season = metadata[.season] as? Int {
let index = metadata.remoteArtworks.count > 1 ? 1 : 0
metadata.remoteArtworks.insert(contentsOf: searchSeasons(id: id, season: season, store: store), at: index)
let seasonArtworks = searchSeasons(id: id, season: season, store: store)
if let season16x9 = seasonArtworks.first(where: { $0.size == .rectangle } ) {
metadata.remoteArtworks.insert(season16x9, at: index)
}
}
metadata.remoteArtworks.sortTopPicks(service: self.name)
return metadata
}
@@ -221,7 +227,8 @@ public struct AppleTV: MetadataService {
let urlString = "\(seasonsURL)\(id)/itunesSeasons?sf=\(store.storeCode)&locale=\(store.language2)\(options)"
if let url = URL(string: urlString), let results = sendJSONRequest(url: url, type: Wrapper<Seasons>.self) {
let filteredResults = results.data.seasons.values.joined().filter { $0.seasonNumber == season }
return filteredResults.compactMap { $0.images.coverArt16X9?.artwork(type: .season) }
return filteredResults.compactMap { $0.images.coverArt16X9?.artwork(type: .season) } +
filteredResults.compactMap { $0.images.coverArt?.artwork(type: .season) }
}
return []
}
@@ -236,7 +243,7 @@ public struct AppleTV: MetadataService {
let items = results.data.canvas?.shelves.first?.items
.filter { $0.type == type.description }
if let result = items?.filter({ $0.title == normalizedTerm }).first {
if let result = items?.filter({ $0.title?.caseInsensitiveCompare(normalizedTerm) == .orderedSame }).first {
return result
} else if let result = items?.filter({ $0.title?.minimumEditDistance(other: normalizedTerm) ?? Int.max < 8 }).first {
return result
@@ -247,15 +254,29 @@ public struct AppleTV: MetadataService {
if let filteredResult = filteredResult {
if let artworks = filteredResult.images.coverArt16X9?.artwork(type: .poster) {
var artworksSet = Set<Artwork>()
if case let MediaType.tvShow(season) = type {
if let season = season {
return [artworks] + searchSeasons(id: filteredResult.id, season: season, store: store)
if let poster = filteredResult.images.coverArt16X9?.artwork(type: .poster) {
artworksSet.insert(poster)
}
if let poster = filteredResult.images.coverArt?.artwork(type: .poster) {
artworksSet.insert(poster)
}
if case let MediaType.tvShow(season) = type {
if let season = season {
let seasonArtworks = searchSeasons(id: filteredResult.id, season: season, store: store)
if let season16x9 = seasonArtworks.first(where: { $0.size == .rectangle } ) {
artworksSet.insert(season16x9)
}
if let seasonSquare = seasonArtworks.first(where: { $0.size == .square } ) {
artworksSet.insert(seasonSquare)
}
}
return [artworks]
}
return Array(artworksSet)
}
}
return []
@@ -113,6 +113,55 @@ public struct Artwork: Equatable, Hashable {
}
}
extension Array where Element == Artwork {
func first(by type: ArtworkType, size: ArtworkSize, service: String) -> Artwork? {
if type == .backdrop || type == .episode {
let serviceArtwork = self.filter { $0.type == type && $0.service == service }.first
let artwork = self.filter { $0.type == type }.first
return serviceArtwork != nil ? serviceArtwork : artwork
}
else {
let serviceArtwork = self.filter { $0.type == type && $0.size == size && $0.service == service }.first
let artwork = self.filter { $0.type == type && $0.size == size}.first
return serviceArtwork != nil ? serviceArtwork : artwork
}
}
mutating func sortTopPicks(service: String) {
let poster = first(by: .poster, size: .standard, service: service)
let posterRect = first(by: .poster, size: .rectangle, service: AppleTV().name)
let posterSquare = first(by: .poster, size: .square, service: AppleTV().name)
let season = first(by: .season, size: .standard, service: service)
let seasonRect = first(by: .season, size: .rectangle, service: AppleTV().name)
let seasonSquare = first(by: .season, size: .square, service: AppleTV().name)
let backdrop = first(by: .backdrop, size: .standard, service: service)
let episode = first(by: .episode, size: .standard, service: service)
let topPicks = [poster, posterRect, posterSquare,
season, seasonRect, seasonSquare,
backdrop, episode]
for pick in topPicks {
if let pick, let index = firstIndex(of: pick) {
remove(at: index)
}
}
for pick in topPicks.reversed() {
if let pick {
insert(pick, at: 0)
}
}
}
func sortedTopPicks(service: String) -> [Self.Element] {
var sorted = self
sorted.sortTopPicks(service: service)
return sorted
}
}
public enum MediaKind: Int {
case tvShow = 10
case movie = 9
+4 -22
View File
@@ -111,16 +111,9 @@ public struct TheMovieDB: MetadataService {
private func loadMovieArtworks(result: TMDBMovie) -> [Artwork] {
var artworks: [Artwork] = []
var iTunesImage = [Artwork](), appleTV = [Artwork]()
var appleTV = [Artwork]()
let group = DispatchGroup()
DispatchQueue.global().async(group: group) {
// add iTunes artwork
if let title = result.title, let iTunesMetadata = iTunesStore.quickiTunesSearch(movieName: title) {
iTunesImage = iTunesMetadata.remoteArtworks
}
}
DispatchQueue.global().async(group: group) {
if let title = result.title,
let store = iTunesStore.Store(language: "USA (English)") {
@@ -130,7 +123,6 @@ public struct TheMovieDB: MetadataService {
group.wait()
artworks.append(contentsOf: appleTV)
artworks.append(contentsOf: iTunesImage)
// Add TheMovieDB artworks
if let config = session.fetchConfiguration()?.images,
@@ -154,7 +146,7 @@ public struct TheMovieDB: MetadataService {
}
return artworks
return artworks.sortedTopPicks(service: self.name)
}
private func metadata(forResult result: TMDBMovie, language: String?) -> MetadataResult {
@@ -379,17 +371,8 @@ public struct TheMovieDB: MetadataService {
artworks.insert(contentsOf: metadata.remoteArtworks, at: 0)
var iTunesImage = [Artwork](), appleTV = [Artwork](), squareTVArt = [Artwork]()
var appleTV = [Artwork](), squareTVArt = [Artwork]()
let group = DispatchGroup()
DispatchQueue.global().async(group: group) {
// add iTunes artwork
if let name = metadata[.seriesName] as? String,
let iTunesMetadata = iTunesStore.quickiTunesSearch(tvSeriesName: name,
seasonNum: metadata[.season] as? Int,
episodeNum: metadata[.episodeNumber] as? Int) {
iTunesImage = iTunesMetadata.remoteArtworks
}
}
DispatchQueue.global().async(group: group) {
if let name = metadata[.seriesName] as? String,
let season = metadata[.season] as? Int,
@@ -404,11 +387,10 @@ public struct TheMovieDB: MetadataService {
}
group.wait()
artworks.insert(contentsOf: iTunesImage, at: 0)
artworks.insert(contentsOf: squareTVArt, at: 0)
artworks.insert(contentsOf: appleTV, at: 0)
metadata.remoteArtworks = artworks
metadata.remoteArtworks = artworks.sortedTopPicks(service: self.name)
return metadata
}
+13 -30
View File
@@ -38,7 +38,7 @@ public struct TheTVDB : MetadataService {
var results: Set<String> = Set()
let series = session.fetch(series: tvShow)
results.formUnion(series.compactMap { $0.translations?[language] } )
results.formUnion(series.compactMap { $0.translations?[language] ?? $0.name } )
if results.isEmpty {
return TheMovieDB().search(tvShow: tvShow, language: language)
@@ -49,8 +49,9 @@ public struct TheTVDB : MetadataService {
// MARK: - TV Series ID search
private func match(series: TVDBSearchResult, name: String) -> Bool {
if let seriesName = series.name, seriesName.caseInsensitiveCompare(name) == .orderedSame {
private func match(series: TVDBSearchResult, name: String, language: String) -> Bool {
if let seriesName = series.translations?[language] ?? series.name,
seriesName.caseInsensitiveCompare(name) == .orderedSame {
return true
}
@@ -72,7 +73,9 @@ public struct TheTVDB : MetadataService {
let order = name?.caseInsensitiveCompare(seriesName)
return order == .orderedSame ? true : false
}
let filteredSeries = sorted.filter { $0.status?.isEmpty == false && match(series: $0, name: seriesName) }.map { $0.tvdb_id }
let filteredSeries = sorted.filter {
$0.status?.isEmpty == false && match(series: $0, name: seriesName, language: language)
}.map { $0.tvdb_id }
if filteredSeries.isEmpty == false {
return filteredSeries
@@ -369,16 +372,6 @@ public struct TheTVDB : MetadataService {
// MARK: - Additional metadata
private func loadiTunesArtwork(_ metadata: MetadataResult) -> [Artwork] {
guard let name = metadata[.seriesName] as? String,
let seasonNum = metadata[.season] as? Int,
let episodeNum = metadata[.episodeNumber] as? Int,
let result = iTunesStore.quickiTunesSearch(tvSeriesName: name, seasonNum: seasonNum, episodeNum: episodeNum)
else { return [] }
return result.remoteArtworks
}
private func loadSquareTVArtwork(_ metadata: MetadataResult) -> [Artwork] {
guard let tvShow = metadata[.seriesName] as? String,
let seasonNum = metadata[.season] as? Int,
@@ -421,11 +414,8 @@ public struct TheTVDB : MetadataService {
// Get additionals images
if ((metadata[.season] as? Int) != nil) {
var iTunesImage = [Artwork](), appleTV = [Artwork](), squareTVArt = [Artwork]()
var appleTV = [Artwork](), squareTVArt = [Artwork]()
let group = DispatchGroup()
DispatchQueue.global().async(group: group) {
iTunesImage = self.loadiTunesArtwork(metadata)
}
DispatchQueue.global().async(group: group) {
squareTVArt = self.loadSquareTVArtwork(metadata)
}
@@ -434,12 +424,12 @@ public struct TheTVDB : MetadataService {
}
group.wait()
artworks.insert(contentsOf: iTunesImage, at: 0)
artworks.insert(contentsOf: squareTVArt, at: 0)
artworks.insert(contentsOf: appleTV, at: 0)
}
metadata.remoteArtworks.insert(contentsOf: artworks, at: 0)
metadata.remoteArtworks.sortTopPicks(service: self.name)
return metadata
}
@@ -467,6 +457,7 @@ public struct TheTVDB : MetadataService {
public func loadMovieMetadata(_ metadata: MetadataResult, language: String) -> MetadataResult {
guard let movieID = metadata[.serviceContentID] as? String,
let name = metadata[.name] as? String,
let info = session.fetch(movieInfo: movieID)
else { return metadata }
@@ -486,28 +477,20 @@ public struct TheTVDB : MetadataService {
var artworks: [Artwork] = []
artworks += cleanArtworks(info.artworks)
var iTunesImage = [Artwork](), appleTV = [Artwork]()
var appleTV = [Artwork]()
let group = DispatchGroup()
let queue = DispatchQueue.global()
queue.async(group: group) {
// add iTunes artwork
if let iTunesMetadata = iTunesStore.quickiTunesSearch(movieName: info.name) {
iTunesImage = iTunesMetadata.remoteArtworks
}
}
queue.async(group: group) {
if let store = iTunesStore.Store(language: "USA (English)") {
appleTV = AppleTV().searchArtwork(term: info.name, store: store, type: .movie)
appleTV = AppleTV().searchArtwork(term: name, store: store, type: .movie)
}
}
group.wait()
artworks.insert(contentsOf: iTunesImage, at: 0)
artworks.insert(contentsOf: appleTV, at: 0)
metadata.remoteArtworks = artworks
metadata.remoteArtworks = artworks.sortedTopPicks(service: self.name)
return metadata
}
+4 -4
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24127" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="25098" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24127"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="25098"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -14,9 +14,9 @@
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<view wantsLayer="YES" id="HYk-Hf-rvN">
<rect key="frame" x="0.0" y="0.0" width="540" height="520"/>
<rect key="frame" x="0.0" y="0.0" width="590" height="520"/>
<autoresizingMask key="autoresizingMask"/>
<point key="canvasLocation" x="220" y="74"/>
<point key="canvasLocation" x="327" y="14"/>
</view>
</objects>
</document>
-1
View File
@@ -37,7 +37,6 @@ final class OffsetViewController: NSViewController {
@IBAction func setOffset(_ sender: Any) {
if track.startOffset != offsetField.doubleValue {
track.startOffset = offsetField.doubleValue
doc.updateChangeCount(.changeDone)
}
presentingViewController?.dismiss(self)
}
+4 -1
View File
@@ -104,7 +104,7 @@ enum Prefs {
_audioBitrate, _audioDRC, _audioConvertAC3, _audioKeepAC3, _audioConvertDts,
_audioDtsOptions, _subtitleConvertBitmap, _ratingsCountry, _chaptersPreviewPosition,
_chaptersPreviewTrack, _mp464bitOffset, _mp464bitTimes, _mp4SaveAsOptimize, _forceHvc1,
_logFormat, _saveAsLocation])
_logFormat, _saveAsLocation, _set4KHDVideoMetadata])
}
@Stored(key: "NSApplicationCrashOnException", defaultValue: true)
@@ -176,6 +176,9 @@ enum Prefs {
@Stored(key: "SBForceHvc1", defaultValue: true)
static var forceHvc1: Bool
@Stored(key: "SBSet4KHDVideoMetadata", defaultValue: false)
static var set4KHDVideoMetadata: Bool
@Stored(key: "SBArtworkSelectorZoomLevel", defaultValue: 50)
static var artworkSelectorZoomLevel: Float
+4 -1
View File
@@ -159,7 +159,10 @@ class PresetPrefsViewController: NSViewController, SectionsTableViewDataSource,
}
}
tableView.selectRowIndexes(rowIndexes, byExtendingSelection: false)
let count = presetManager.metadataPresets.count + presetManager.queuePresets.count
if let index = rowIndexes.last, index < count {
tableView.selectRowIndexes(rowIndexes, byExtendingSelection: false)
}
}
@IBAction func editPreset(_ sender: NSView) {
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24127" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="25098" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24127"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="25098"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="ChapterViewController" customModule="Subler" customModuleProvider="target">
<connections>
<outlet property="actions" destination="IvH-Ff-dyN" id="EiR-xB-dq9"/>
<outlet property="removeChapter" destination="31" id="faJ-CI-g36"/>
<outlet property="tabView" destination="10" id="CC8-n9-JPu"/>
<outlet property="tableView" destination="22" id="7Za-v5-yKx"/>
@@ -30,13 +31,13 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView autohidesScrollers="YES" horizontalLineScroll="16" horizontalPageScroll="10" verticalLineScroll="16" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="19">
<rect key="frame" x="17" y="40" width="719" height="191"/>
<rect key="frame" x="17" y="44" width="719" height="187"/>
<clipView key="contentView" id="gfP-N5-8Ji">
<rect key="frame" x="1" y="1" width="717" height="189"/>
<rect key="frame" x="1" y="1" width="717" height="185"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" tableStyle="plain" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowHeight="14" headerView="23" viewBased="YES" id="22" customClass="ExpandedTableView" customModule="Subler" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="717" height="172"/>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" tableStyle="plain" columnSelection="YES" autosaveColumns="NO" rowHeight="14" headerView="23" viewBased="YES" id="22" customClass="ExpandedTableView" customModule="Subler" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="717" height="168"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -383,7 +384,7 @@
</tableHeaderView>
</scrollView>
<button toolTip="Add chapter" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="42">
<rect key="frame" x="11" y="9" width="36" height="27"/>
<rect key="frame" x="17" y="16" width="32" height="20"/>
<buttonCell key="cell" type="push" bezelStyle="rounded" image="NSAddTemplate" imagePosition="only" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="43">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
@@ -393,7 +394,7 @@
</connections>
</button>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IvH-Ff-dyN">
<rect key="frame" x="70" y="12" width="45" height="22"/>
<rect key="frame" x="90" y="16" width="53" height="20"/>
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="center" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" pullsDown="YES" id="frw-Vk-Gwo">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="controlContent" size="11"/>
@@ -413,7 +414,7 @@
</popUpButtonCell>
</popUpButton>
<button toolTip="Delete selected chapter" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="31">
<rect key="frame" x="36" y="9" width="36" height="27"/>
<rect key="frame" x="50" y="16" width="32" height="20"/>
<buttonCell key="cell" type="push" bezelStyle="rounded" image="NSRemoveTemplate" imagePosition="only" alignment="center" controlSize="small" enabled="NO" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="32">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
@@ -8,16 +8,21 @@
import Cocoa
import MP42Foundation
final class ChapterViewController : PropertyView, NSTableViewDataSource, NSTableViewDelegate {
final class ChapterViewController : PropertyView, NSTableViewDataSource, NSTableViewDelegate, ExpandedTableViewDelegate {
var track: MP42ChapterTrack {
didSet {
let indexes = tableView.selectedRowIndexes
tableView.reloadData()
if let last = indexes.last, last < track.chapters.count {
tableView.selectRowIndexes(indexes, byExtendingSelection: false)
}
}
}
@IBOutlet var tableView: ExpandedTableView!
@IBOutlet var removeChapter: NSButton!
@IBOutlet var actions: NSPopUpButton!
override var nibName: NSNib.Name? {
return "ChapterView"
@@ -36,6 +41,10 @@ final class ChapterViewController : PropertyView, NSTableViewDataSource, NSTable
super.viewDidLoad()
tableView.defaultEditingColumn = 1
tableView.doubleAction = #selector(doubleClickAction(_:))
if #available(macOS 26, *) {
actions.menu?.items.first?.image = NSImage.init(systemSymbolName: "ellipsis", accessibilityDescription: nil)
}
}
// MARK: Table View
@@ -77,7 +86,6 @@ final class ChapterViewController : PropertyView, NSTableViewDataSource, NSTable
track.setTitle(sender.stringValue, forChapter: chapter)
tableView.reloadData(forRowIndexes: IndexSet(integer: row), columnIndexes: IndexSet(integer: 1))
updateChangeCount()
}
}
@@ -89,7 +97,6 @@ final class ChapterViewController : PropertyView, NSTableViewDataSource, NSTable
track.setTimestamp(timestamp, forChapter: chapter)
tableView.reloadData()
updateChangeCount()
}
}
@@ -99,30 +106,29 @@ final class ChapterViewController : PropertyView, NSTableViewDataSource, NSTable
}
}
// MARK: Actions
private func updateChangeCount() {
view.window?.windowController?.document?.updateChangeCount(NSDocument.ChangeType.changeDone)
}
@IBAction func removeChapter(_ sender: Any) {
let currentIndex = tableView.selectedRow
if currentIndex < track.chapterCount() {
track.removeChapter(at: UInt(currentIndex))
let indexes = IndexSet(integer: currentIndex)
func deleteSelection(in tableview: NSTableView) {
let indexes = tableView.selectedRowIndexes
if indexes.isEmpty == false {
track.removeChapters(at: indexes)
tableView.removeRows(at: indexes, withAnimation: NSTableView.AnimationOptions.slideUp)
tableView.selectRowIndexes(indexes, byExtendingSelection: false)
updateChangeCount()
if let index = indexes.first, index < track.chapters.count {
tableView.selectRowIndexes(IndexSet(integer: index), byExtendingSelection: false)
}
}
}
@IBAction func addChapter(_ sender: Any) {
track.addChapter("Chapter", timestamp: 0)
// MARK: Actions
tableView.reloadData()
updateChangeCount()
@IBAction func removeChapter(_ sender: Any) {
deleteSelection(in: tableView)
}
@IBAction func addChapter(_ sender: Any) {
let index = track.addChapter("Chapter", timestamp: 0)
let indexSet = IndexSet(integer: Int(index))
tableView.insertRows(at: indexSet, withAnimation: .slideDown)
tableView.selectRowIndexes(indexSet, byExtendingSelection: false)
view.window?.makeFirstResponder(tableView)
}
@IBAction func renameChapters(_ sender: Any) {
@@ -131,7 +137,6 @@ final class ChapterViewController : PropertyView, NSTableViewDataSource, NSTable
track.setTitle(title, forChapter: chapter)
}
tableView.reloadData()
updateChangeCount()
}
}
@@ -176,7 +176,5 @@ final class MediaTagsController: NSViewController, NSTableViewDataSource, NSTabl
private func updateTrack() {
let updatedTags = tags.filter { $0.state }.map { $0.value }
track.mediaCharacteristicTags = Set(updatedTags)
view.window?.windowController?.document?.updateChangeCount(.changeDone)
}
}
+17 -71
View File
@@ -18,7 +18,13 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
var metadata: MP42Metadata {
didSet {
let metadataIndexes = self.metadataTableView.selectedRowIndexes
// let artworkIndexes = self.artworksView.selectionIndexPaths;
reloadData()
if let last = metadataIndexes.last, last < tags.count {
self.metadataTableView.selectRowIndexes(metadataIndexes, byExtendingSelection: false)
}
// self.artworksView.selectItems(at: artworkIndexes, scrollPosition: .top)
}
}
@@ -152,7 +158,11 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
metadataTableView.reloadData()
updateArtworksArray()
artworksView.reloadData()
view.undoManager?.removeAllActions(withTarget: self)
updateUI()
}
private func updateUI() {
removeTagButton.isEnabled = self.metadataTableView.selectedRow != -1
}
// MARK: Metadata
@@ -180,17 +190,6 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
metadata.addItem(item)
rowHeights[item.identifier] = nil
}
if let undo = view.undoManager {
undo.registerUndo(withTarget: self) { (target) in
target.remove(metadataItems: items)
}
if undo.isUndoing == false {
undo.setActionName(NSLocalizedString("Insert", comment: "Undo tag insert."))
}
}
updateMetadataArray()
metadataTableView.reloadData()
}
@@ -199,38 +198,19 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
for item in items {
metadata.removeItem(item)
}
if let undo = view.undoManager {
undo.registerUndo(withTarget: self) { (target) in
target.add(metadataItems: items)
}
if undo.isUndoing == false {
undo.setActionName(NSLocalizedString("Delete", comment: "Undo tag delete."))
}
}
updateMetadataArray()
let index = metadataTableView.selectedRowIndexes.first ?? 0
metadataTableView.reloadData()
if index < tags.count {
metadataTableView.selectRowIndexes(IndexSet(integer: index), byExtendingSelection: false)
}
updateUI()
}
private func replace(metadataItem item: MP42MetadataItem, withItem newItem: MP42MetadataItem) {
metadata.removeItem(item)
metadata.addItem(newItem)
if let undo = view.undoManager {
undo.registerUndo(withTarget: self) { (target) in
target.replace(metadataItem: newItem, withItem: item)
}
if undo.isUndoing == false {
undo.setActionName(NSLocalizedString("Editing", comment: "Undo tag editing."))
view.window?.windowController?.document?.updateChangeCount(.changeDone)
} else {
view.window?.windowController?.document?.updateChangeCount(.changeUndone)
}
}
updateMetadataArray()
NSAnimationContext.beginGrouping()
@@ -834,8 +814,7 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
}
func tableViewSelectionDidChange(_ notification: Notification) {
let enabled = metadataTableView.selectedRow != -1 ? true : false
removeTagButton.isEnabled = enabled
updateUI()
}
// MARK: Artworks
@@ -846,34 +825,12 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
private func add(metadataArtworks items: [MP42MetadataItem]) {
metadata.addItems(items)
if let undo = view.undoManager {
undo.registerUndo(withTarget: self) { (target) in
target.remove(metadataArtworks: items)
}
if undo.isUndoing == false {
undo.setActionName(NSLocalizedString("Insert", comment: "Undo cover art insert."))
}
}
updateArtworksArray()
artworksView.reloadData()
}
private func remove(metadataArtworks items: [MP42MetadataItem]) {
metadata.removeItems(items)
if let undo = view.undoManager {
undo.registerUndo(withTarget: self) { (target) in
target.add(metadataArtworks: items)
}
if undo.isUndoing == false {
undo.setActionName(NSLocalizedString("Delete", comment: "Undo cover art delete"))
}
}
updateArtworksArray()
artworksView.reloadData()
updateSelection()
@@ -882,17 +839,6 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
private func replace(metadataArtworks items: [MP42MetadataItem], withItems newItems: [MP42MetadataItem]) {
metadata.removeItems(items)
metadata.addItems(newItems)
if let undo = view.undoManager {
undo.registerUndo(withTarget: self) { (target) in
target.replace(metadataArtworks: newItems, withItems: items)
}
if undo.isUndoing == false {
undo.setActionName(NSLocalizedString("Move", comment: "Undo cover art delete"))
}
}
updateArtworksArray()
artworksView.reloadData()
updateSelection()
@@ -118,15 +118,10 @@ final class SoundViewController : PropertyView {
// MARK: Actions
private func updateChangeCount() {
view.window?.windowController?.document?.updateChangeCount(NSDocument.ChangeType.changeDone)
}
@IBAction func setTrackVolume(_ sender: NSSlider) {
let value = sender.floatValue / 100
if value != track.volume {
track.volume = value
updateChangeCount()
}
}
@@ -134,12 +129,10 @@ final class SoundViewController : PropertyView {
if let newFallbackTrack = sender.representedObject as? MP42AudioTrack {
if newFallbackTrack != track.fallbackTrack {
track.fallbackTrack = newFallbackTrack
updateChangeCount()
}
}
else {
track.fallbackTrack = nil
updateChangeCount()
}
}
@@ -147,12 +140,10 @@ final class SoundViewController : PropertyView {
if let newFollowsTrack = sender.representedObject as? MP42SubtitleTrack {
if newFollowsTrack != track.followsTrack {
track.followsTrack = newFollowsTrack
updateChangeCount()
}
}
else {
track.followsTrack = nil
updateChangeCount()
}
}
@@ -160,7 +151,6 @@ final class SoundViewController : PropertyView {
if let group = sender.selectedItem?.tag {
if track.alternateGroup != group {
track.alternateGroup = UInt64(group)
updateChangeCount()
}
}
}
@@ -254,10 +254,6 @@ final class VideoViewController: PropertyView {
// MARK: Actions
private func updateChangeCount() {
view.window?.windowController?.document?.updateChangeCount(NSDocument.ChangeType.changeDone)
}
@IBAction func setSize(_ sender: NSTextField) {
if sender == trackWidth {
let value = trackWidth.floatValue
@@ -267,13 +263,11 @@ final class VideoViewController: PropertyView {
trackHeight.floatValue = track.trackHeight
}
track.trackWidth = value
updateChangeCount()
}
} else if sender == trackHeight {
let value = trackHeight.floatValue
if track.trackHeight != value {
track.trackHeight = value
updateChangeCount()
}
} else if sender == offsetX {
let value = CGFloat(offsetX.integerValue)
@@ -281,7 +275,6 @@ final class VideoViewController: PropertyView {
var transform = track.transform
transform.tx = value
track.transform = transform
updateChangeCount()
}
} else if sender == offsetY {
let value = CGFloat(offsetY.integerValue)
@@ -289,7 +282,6 @@ final class VideoViewController: PropertyView {
var transform = track.transform
transform.ty = value
track.transform = transform
updateChangeCount()
}
}
}
@@ -299,14 +291,12 @@ final class VideoViewController: PropertyView {
let value = UInt64(hSpacing.integerValue)
if track.hSpacing != value {
track.hSpacing = value
updateChangeCount()
}
}
else if sender == vSpacing {
let value = UInt64(vSpacing.intValue)
if track.vSpacing != value {
track.vSpacing = value
updateChangeCount()
}
}
}
@@ -346,7 +336,6 @@ final class VideoViewController: PropertyView {
track.colorPrimaries = colorTag.0
track.transferCharacteristics = colorTag.1
track.matrixCoefficients = colorTag.2
updateChangeCount()
}
}
@@ -370,7 +359,6 @@ final class VideoViewController: PropertyView {
default:
return
}
updateChangeCount()
}
@IBAction func setForcedSubtitles(_ sender: NSPopUpButton) {
@@ -391,7 +379,6 @@ final class VideoViewController: PropertyView {
if track.someSamplesAreForced != value.0 || track.allSamplesAreForced != value.1 {
track.someSamplesAreForced = value.0
track.allSamplesAreForced = value.1
updateChangeCount()
}
}
}
@@ -401,12 +388,10 @@ final class VideoViewController: PropertyView {
if let newForcedTrack = sender.representedObject as? MP42SubtitleTrack {
if newForcedTrack != track.forcedTrack {
track.forcedTrack = newForcedTrack
updateChangeCount()
}
}
else {
track.forcedTrack = nil
updateChangeCount()
}
}
}
@@ -415,7 +400,6 @@ final class VideoViewController: PropertyView {
if let group = sender.selectedItem?.tag {
if track.alternateGroup != group {
track.alternateGroup = UInt64(group)
updateChangeCount()
}
}
}
+1
View File
@@ -54,6 +54,7 @@ final class Queue {
}
unarchiver.finishDecoding()
} catch {
self.logger.writeError(toLog: error)
items = []
}
+3 -20
View File
@@ -176,23 +176,6 @@ class QueueSetAction : NSObject, QueueActionProtocol {
}
extension Array where Element == Artwork {
func filter(by type: ArtworkType, size: ArtworkSize, service: String) -> Artwork? {
if type == .backdrop || type == .episode {
let serviceArtwork = self.filter { $0.type == type && $0.service == service }.first
let artwork = self.filter { $0.type == type }.first
return serviceArtwork != nil ? serviceArtwork : artwork
}
else {
let serviceArtwork = self.filter { $0.type == type && $0.size == size && $0.service == service }.first
let artwork = self.filter { $0.type == type && $0.size == size}.first
return serviceArtwork != nil ? serviceArtwork : artwork
}
}
}
/// An action that fetches metadata online.
class QueueMetadataAction : NSObject, QueueActionProtocol {
@@ -263,13 +246,13 @@ class QueueMetadataAction : NSObject, QueueActionProtocol {
let artwork: Artwork? = {
let provider = terms.isMovie ? self.movieProvider : self.tvShowProvider
let type = terms.isMovie && preferredArtwork.isMovieType == false ? .poster : preferredArtwork
if let artwork = artworks.filter(by: type, size: preferredArtworkSize, service: provider) {
if let artwork = artworks.first(by: type, size: preferredArtworkSize, service: provider) {
return artwork
}
else if let artwork = artworks.filter(by: .season, size: preferredArtworkSize, service: provider) {
else if let artwork = artworks.first(by: .season, size: preferredArtworkSize, service: provider) {
return artwork
}
else if let artwork = artworks.filter(by: .poster, size: .standard, service: provider) {
else if let artwork = artworks.first(by: .poster, size: .standard, service: provider) {
return artwork
}
else {
+3 -1
View File
@@ -455,7 +455,9 @@ final class QueueController : NSWindowController, NSWindowDelegate, NSPopoverDel
}
table.removeRows(at: indexes, withAnimation: .slideUp)
table.selectRowIndexes(IndexSet(integer: indexes.first!), byExtendingSelection: false)
if let index = indexes.first, index < queue.count {
table.selectRowIndexes(IndexSet(integer: index), byExtendingSelection: false)
}
table.endUpdates()
updateState()
+12 -5
View File
@@ -415,8 +415,8 @@ import MP42Foundation
statusInternal = QueueItem.Status(rawValue: Int(aDecoder.decodeInt32(forKey: "SBQueueItemStatus"))) ?? .failed
mp4File = aDecoder.decodeObject(of: [MP42File.classForCoder()], forKey: "SBQueueItemMp4File") as? MP42File
uniqueID = aDecoder.decodeObject(of: [NSString.classForCoder()], forKey: "SBQueueItemID") as! String
attributes = aDecoder.decodeObject(of: [NSDictionary.classForCoder(), NSString.classForCoder(), NSNumber.classForCoder()], forKey: "SBQueueItemAttributes") as! [String : Any]
uniqueID = aDecoder.decodeObject(of: [NSString.classForCoder()], forKey: "SBQueueItemID") as? String ?? UUID().uuidString
attributes = aDecoder.decodeObject(of: [NSDictionary.classForCoder(), NSString.classForCoder(), NSNumber.classForCoder()], forKey: "SBQueueItemAttributes") as? [String : Any] ?? [:]
#if SB_SANDBOX
if var bookmark = aDecoder.decodeObject(of: [NSData.classForCoder()], forKey: "SBQueueItemFileURLBookmark") as? Data {
@@ -449,8 +449,14 @@ import MP42Foundation
return nil
}
#else
fileURL = aDecoder.decodeObject(of: [NSURL.classForCoder()], forKey: "SBQueueItemFileURL") as! URL
destURLInternal = aDecoder.decodeObject(of: [NSURL.classForCoder()], forKey: "SBQueueItemDestURL") as! URL
if let fileURL = aDecoder.decodeObject(of: [NSURL.classForCoder()], forKey: "SBQueueItemFileURL") as? URL,
let destURLInternal = aDecoder.decodeObject(of: [NSURL.classForCoder()], forKey: "SBQueueItemDestURL") as? URL {
self.fileURL = fileURL
self.destURLInternal = destURLInternal
} else {
return nil
}
#endif
actionsInternal = aDecoder.decodeObject(of: [NSArray.classForCoder(), QueueSetAction.classForCoder(),
@@ -460,7 +466,8 @@ import MP42Foundation
QueueRenameChaptersAction.classForCoder(),
QueueOrganizeGroupsAction.classForCoder(), QueueColorSpaceAction.classForCoder(),
QueueSetOutputFilenameAction.classForCoder(), QueueClearExistingMetadataAction.classForCoder(),
QueueOptimizeAction.classForCoder(), QueueSendToiTunesAction.classForCoder()], forKey: "SBQueueItemActions") as! [QueueActionProtocol]
QueueOptimizeAction.classForCoder(), QueueSendToiTunesAction.classForCoder(),
QueueChangeAudioLanguageAction.classForCoder(), QueueChangeSubtitleLanguageAction.classForCoder()], forKey: "SBQueueItemActions") as? [QueueActionProtocol] ?? []
}
}
+12 -17
View File
@@ -119,8 +119,7 @@ class SBFetchMetadataScriptCommand: NSScriptCommand, ScriptCommandDocumentTarget
if let metadata = metadata {
// Apply the metadata to the file
mp4File.metadata.merge(metadata, overwrite: true)
sublerDoc.updateChangeCount(.changeDone)
// Trigger UI refresh by calling reloadData on the window controller
if let windowController = sublerDoc.windowControllers.first as? DocumentWindowController {
windowController.reloadData()
@@ -165,9 +164,9 @@ class SBFetchMetadataScriptCommand: NSScriptCommand, ScriptCommandDocumentTarget
if preferredArtwork != .none && artworks.isEmpty == false {
let artwork: Artwork? = {
let type = preferredArtwork.isMovieType ? preferredArtwork : .poster
if let artwork = artworks.filter(by: type, size: preferredArtworkSize, service: movieService.name) {
if let artwork = artworks.first(by: type, size: preferredArtworkSize, service: movieService.name) {
return artwork
} else if let artwork = artworks.filter(by: .poster, size: .standard, service: movieService.name) {
} else if let artwork = artworks.first(by: .poster, size: .standard, service: movieService.name) {
return artwork
} else {
return artworks.first
@@ -207,11 +206,11 @@ class SBFetchMetadataScriptCommand: NSScriptCommand, ScriptCommandDocumentTarget
if preferredArtwork != .none && artworks.isEmpty == false {
let artwork: Artwork? = {
if let artwork = artworks.filter(by: preferredArtwork, size: preferredArtworkSize, service: tvShowService.name) {
if let artwork = artworks.first(by: preferredArtwork, size: preferredArtworkSize, service: tvShowService.name) {
return artwork
} else if let artwork = artworks.filter(by: .season, size: preferredArtworkSize, service: tvShowService.name) {
} else if let artwork = artworks.first(by: .season, size: preferredArtworkSize, service: tvShowService.name) {
return artwork
} else if let artwork = artworks.filter(by: .poster, size: .standard, service: tvShowService.name) {
} else if let artwork = artworks.first(by: .poster, size: .standard, service: tvShowService.name) {
return artwork
} else {
return artworks.first
@@ -386,8 +385,7 @@ class SBSaveAsScriptCommand: NSScriptCommand, ScriptCommandDocumentTargeting {
// Update the document's file URL and mark as saved
sublerDoc.fileURL = destinationURL
sublerDoc.updateChangeCount(.changeCleared)
// End progress reporting and refresh the UI
windowController.endProgressReporting()
windowController.reloadData()
@@ -396,8 +394,7 @@ class SBSaveAsScriptCommand: NSScriptCommand, ScriptCommandDocumentTargeting {
} else {
// Update the document's file URL and mark as saved
sublerDoc.fileURL = destinationURL
sublerDoc.updateChangeCount(.changeCleared)
// End progress reporting and refresh the UI
windowController.endProgressReporting()
windowController.reloadData()
@@ -783,9 +780,9 @@ class SBFetchAndSetMetadataResultScriptCommand: NSScriptCommand, ScriptCommandDo
if preferredArtwork != .none && artworks.isEmpty == false {
let artwork: Artwork? = {
let type = preferredArtwork.isMovieType ? preferredArtwork : .poster
if let artwork = artworks.filter(by: type, size: preferredArtworkSize, service: movieService.name) {
if let artwork = artworks.first(by: type, size: preferredArtworkSize, service: movieService.name) {
return artwork
} else if let artwork = artworks.filter(by: .poster, size: .standard, service: movieService.name) {
} else if let artwork = artworks.first(by: .poster, size: .standard, service: movieService.name) {
return artwork
} else {
return artworks.first
@@ -807,7 +804,6 @@ class SBFetchAndSetMetadataResultScriptCommand: NSScriptCommand, ScriptCommandDo
DispatchQueue.main.async {
if let sublerDoc = self.targetedDocument() {
sublerDoc.mp4.metadata.merge(mappedMetadata, overwrite: true)
sublerDoc.updateChangeCount(.changeDone)
completion(true)
} else {
completion(false)
@@ -833,9 +829,9 @@ class SBFetchAndSetMetadataResultScriptCommand: NSScriptCommand, ScriptCommandDo
if preferredArtwork != .none && artworks.isEmpty == false {
let artwork: Artwork? = {
let type = preferredArtwork.isMovieType ? preferredArtwork : .poster
if let artwork = artworks.filter(by: type, size: preferredArtworkSize, service: tvShowService.name) {
if let artwork = artworks.first(by: type, size: preferredArtworkSize, service: tvShowService.name) {
return artwork
} else if let artwork = artworks.filter(by: .poster, size: .standard, service: tvShowService.name) {
} else if let artwork = artworks.first(by: .poster, size: .standard, service: tvShowService.name) {
return artwork
} else {
return artworks.first
@@ -857,7 +853,6 @@ class SBFetchAndSetMetadataResultScriptCommand: NSScriptCommand, ScriptCommandDo
DispatchQueue.main.async {
if let sublerDoc = self.targetedDocument() {
sublerDoc.mp4.metadata.merge(mappedMetadata, overwrite: true)
sublerDoc.updateChangeCount(.changeDone)
completion(true)
} else {
completion(false)
+19 -4
View File
@@ -23,7 +23,7 @@ final class TracksViewController: NSViewController, NSTableViewDataSource, NSTab
didSet {
let selectedIndexes = tracksTable.selectedRowIndexes
reloadData()
if let max = selectedIndexes.max(), mp4.tracks.count >= max {
if let last = selectedIndexes.last, last <= mp4.tracks.count {
tracksTable.selectRowIndexes(selectedIndexes, byExtendingSelection: false)
}
}
@@ -66,10 +66,28 @@ final class TracksViewController: NSViewController, NSTableViewDataSource, NSTab
}
func reloadData() {
let indexes = tracksTable.selectedRowIndexes
tracksTable.reloadData()
if let last = indexes.last, last <= mp4.tracks.count {
tracksTable.selectRowIndexes(indexes, byExtendingSelection: false)
}
delegate?.didSelect(tracks: selectedTracks)
}
func selectTracks(_ tracks: [MP42Track]) {
var indexes = IndexSet()
for track in tracks {
if let trackIndex = mp4.tracks.firstIndex(of: track) {
indexes.insert(trackIndex + 1)
}
}
if indexes.isEmpty && tracksTable.selectedRow == 0 {
indexes.insert(0)
}
tracksTable.selectRowIndexes(indexes, byExtendingSelection: false)
}
var selectedTracks: [MP42Track] {
return tracksTable != nil ? tracksTable.selectedRowIndexes.compactMap { track(at: $0) } : []
}
@@ -100,7 +118,6 @@ final class TracksViewController: NSViewController, NSTableViewDataSource, NSTab
let row = tracksTable.row(for: sender)
if let track = track(at: row) {
track.isEnabled = sender.state == NSControl.StateValue.on ? true : false
document.updateChangeCount(.changeDone)
}
}
@@ -108,7 +125,6 @@ final class TracksViewController: NSViewController, NSTableViewDataSource, NSTab
let row = tracksTable.row(for: sender)
if let track = track(at: row), track.name != sender.stringValue {
track.name = sender.stringValue
document.updateChangeCount(.changeDone)
let column = tracksTable.column(for: sender)
tracksTable.reloadData(forRowIndexes: IndexSet(integer: row), columnIndexes: IndexSet(integer: column))
}
@@ -127,7 +143,6 @@ final class TracksViewController: NSViewController, NSTableViewDataSource, NSTab
if let track = track(at: row), track.language != language {
track.language = language ?? "und"
document.updateChangeCount(.changeDone)
}
}
@@ -10,6 +10,9 @@
/* Class = "NSTableColumn"; headerCell.title = "Value"; ObjectID = "Aj4-bk-6RK"; */
"Aj4-bk-6RK.headerCell.title" = "Valore";
/* Class = "NSButton"; ibShadowedToolTip = "4K metadata may cause streaming issues with some Apple TV and iTunes configurations"; ObjectID = "cEs-iS-fwI"; */
"cEs-iS-fwI.ibShadowedToolTip" = "Il metadata 4K può causare problemi di trasmissione con certe configurazioni di Apple TV e iTunes";
/* Class = "NSTextFieldCell"; title = "Map the providers' metadata to the MP4 annotations"; ObjectID = "cUW-9F-EvO"; */
"cUW-9F-EvO.title" = "Associa i metadati dei fornitori alle annotazioni MP4";
@@ -34,3 +37,6 @@
/* Class = "NSTableView"; ibExternalAccessibilityDescription = "Metadata map"; ObjectID = "Tid-Rc-Ljr"; */
"Tid-Rc-Ljr.ibExternalAccessibilityDescription" = "Mappa metadata";
/* Class = "NSButtonCell"; title = "Autodetect 4K HD Video Metadata"; ObjectID = "vyR-ib-B9Q"; */
"vyR-ib-B9Q.title" = "Rileva metadata 4K Video HD";
+11
View File
@@ -1,5 +1,16 @@
# Subler News
## Subler 1.9.5
- Expanded undo/redo support
- Improved artworks order in the artwork selector
- Improved specials (season 0) lookup from file names [brettpynn]
- Improved TVDB tv shows name search
- Added an option to set the 4k HD Video tag when needed [brettpynn]
- Fixed a crash that happened if a queue item contained a "Set language" action
- Minor UI improvements and bug fixes
## Subler 1.9.4
- Added an option to select a default "Save as" location [mindprint]
+4 -4
View File
@@ -1537,7 +1537,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1.9.4;
CURRENT_PROJECT_VERSION = 1.9.5;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = "";
@@ -1557,7 +1557,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.9.4;
MARKETING_VERSION = 1.9.5;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
OTHER_SWIFT_FLAGS = "";
@@ -1583,7 +1583,7 @@
CODE_SIGN_IDENTITY = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1.9.4;
CURRENT_PROJECT_VERSION = 1.9.5;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = "";
@@ -1602,7 +1602,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.9.4;
MARKETING_VERSION = 1.9.5;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
OTHER_SWIFT_FLAGS = "";
@@ -337,7 +337,7 @@ sub new {
# Cosmetics
for my $key (qw(dvd season episode endep part)) {
$self->{$key} =~ s/^0+// if defined $self->{$key};
$self->{$key} =~ s/^0+(?=\d)// if defined $self->{$key};
}
$self->{endep} = undef if $self->{endep} == $self->{episode};
+2 -2
View File
@@ -1,5 +1,5 @@
/* Class = "NSButtonCell"; title = "Load more artwork..."; ObjectID = "40h-Rv-m31"; */
"40h-Rv-m31.title" = "Carica più illustrazioni…";
/* Class = "NSButtonCell"; title = "Load more artworks"; ObjectID = "40h-Rv-m31"; */
"40h-Rv-m31.title" = "Carica più illustrazioni";
/* Class = "NSSlider"; ibExternalAccessibilityDescription = "Zoom"; ObjectID = "fMj-Ew-Qej"; */
"fMj-Ew-Qej.ibExternalAccessibilityDescription" = "Ingrandisci";
+1 -13
View File
@@ -140,9 +140,7 @@ Toolbar */
/* No comment provided by engineer. */
"Day" = "Giorno";
/* Toolbar
Undo cover art delete
Undo tag delete. */
/* Toolbar */
"Delete" = "Elimina";
/* Toolbar */
@@ -190,9 +188,6 @@ Undo tag delete. */
/* Media characteristic. */
"Easy To Read" = "Semplice da leggere";
/* Undo tag editing. */
"Editing" = "Modifico";
/* Enable audio track action description
Enable audio track local description */
"Enabling audio track with selected language" = "Abilito traccia audio con lingua";
@@ -255,10 +250,6 @@ Enable subtitles track local description */
/* Toolbar */
"Import tracks from external files" = "Importa le tracce da un file esterno";
/* Undo cover art insert.
Undo tag insert. */
"Insert" = "Inserisci";
/* Toolbar */
"Insert a chapter every" = "Inserisci un capitolo ogni";
@@ -304,9 +295,6 @@ Undo tag insert. */
/* No comment provided by engineer. */
"Month" = "Mese";
/* Undo cover art delete */
"Move" = "Muovi";
/* Queue -> move add item. */
"Move Queue Item" = "sposta elemento coda";