Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f270e3dca7 | ||
|
|
d78b320322 | ||
|
|
80e561d88c | ||
|
|
210cb96196 | ||
|
|
56c7f01d07 | ||
|
|
04eab36031 | ||
|
|
d88285ece2 | ||
|
|
20a8714974 | ||
|
|
13f1f301e3 | ||
|
|
5890c9abe2 | ||
|
|
2a1d8b08e1 | ||
|
|
971adb6342 | ||
|
|
87837a0f5e | ||
|
|
a4e4b6027d | ||
|
|
bf012927b4 | ||
|
|
3f5c5e7459 | ||
|
|
1fd17a5cd0 | ||
|
|
5965ce4836 | ||
|
|
d9f2681bba | ||
|
|
c256d87e50 |
No files matched your search
@@ -21,25 +21,26 @@
|
||||
<string>windowSize</string>
|
||||
<string>rememberWindowSize</string>
|
||||
<string>chaptersPreviewTrack</string>
|
||||
<string>SBLogFormat</string>
|
||||
</declaredKeys>
|
||||
</userDefaultsController>
|
||||
<customView id="76">
|
||||
<rect key="frame" x="0.0" y="0.0" width="660" height="299"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="660" height="316"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="dxI-5Q-gDD">
|
||||
<rect key="frame" x="136" y="0.0" width="389" height="299"/>
|
||||
<rect key="frame" x="133" y="0.0" width="395" height="316"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="XPF-Mh-XYC">
|
||||
<rect key="frame" x="147" y="139" width="57" height="14"/>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="XPF-Mh-XYC">
|
||||
<rect key="frame" x="147" y="150" width="57" height="14"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Beginning" id="3Vs-qA-7Z6">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="249">
|
||||
<rect key="frame" x="129" y="95" width="165" height="14"/>
|
||||
<textField focusRingType="none" verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="249">
|
||||
<rect key="frame" x="129" y="107" width="165" height="14"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="USA ratings are always shown." id="250">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -47,7 +48,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="133">
|
||||
<rect key="frame" x="125" y="44" width="188" height="32"/>
|
||||
<rect key="frame" x="124" y="43" width="182" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Clear recent searches" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="134">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -57,7 +58,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="80">
|
||||
<rect key="frame" x="129" y="204" width="117" height="18"/>
|
||||
<rect key="frame" x="129" y="217" width="121" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Remember Size" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="86">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -70,8 +71,8 @@
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="139">
|
||||
<rect key="frame" x="18" y="54" width="107" height="16"/>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="139">
|
||||
<rect key="frame" x="18" y="53" width="107" height="16"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Privacy:" id="140">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -79,7 +80,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="82">
|
||||
<rect key="frame" x="129" y="180" width="232" height="18"/>
|
||||
|
||||
<buttonCell key="cell" type="check" title="Create Preview Images at position:" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="84">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -93,15 +94,15 @@
|
||||
</connections>
|
||||
</button>
|
||||
<slider verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="JhA-jk-CGt">
|
||||
<rect key="frame" x="147" y="152" width="214" height="24"/>
|
||||
<rect key="frame" x="147" y="158" width="220" height="28"/>
|
||||
<sliderCell key="cell" state="on" alignment="left" maxValue="1" doubleValue="0.5" tickMarkPosition="below" numberOfTickMarks="7" sliderType="linear" id="iKX-dX-4IV"/>
|
||||
<connections>
|
||||
<binding destination="3" name="value" keyPath="values.SBChaptersPreviewPosition" id="JtQ-lM-MNU"/>
|
||||
<binding destination="3" name="enabled" keyPath="values.chaptersPreviewTrack" id="hNU-uO-zsL"/>
|
||||
</connections>
|
||||
</slider>
|
||||
<textField horizontalHuggingPriority="249" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="206">
|
||||
<rect key="frame" x="18" y="115" width="107" height="16"/>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="249" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="206">
|
||||
<rect key="frame" x="18" y="126" width="107" height="16"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Show ratings for:" id="207">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -109,7 +110,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="136">
|
||||
<rect key="frame" x="125" y="13" width="188" height="32"/>
|
||||
<rect key="frame" x="124" y="13" width="182" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Delete cached metadata" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="137">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -118,8 +119,8 @@
|
||||
<action selector="deleteCachedMetadata:" target="-2" id="141"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="249" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="81">
|
||||
<rect key="frame" x="18" y="181" width="107" height="16"/>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="249" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="81">
|
||||
<rect key="frame" x="18" y="192" width="107" height="16"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Chapters:" id="85">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -127,7 +128,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="B5v-6Q-3Qa">
|
||||
<rect key="frame" x="129" y="242" width="242" height="18"/>
|
||||
<rect key="frame" x="129" y="257" width="246" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Automatically check for update daily" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="2Pf-pq-4IX">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -136,32 +137,48 @@
|
||||
<binding destination="3" name="value" keyPath="values.SUEnableAutomaticChecks" id="6AF-uh-wt7"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="249" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="77">
|
||||
<rect key="frame" x="18" y="263" width="107" height="16"/>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="249" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="77">
|
||||
<rect key="frame" x="18" y="280" width="107" height="16"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="At Launch:" id="89">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tVb-Qq-sU7">
|
||||
<rect key="frame" x="337" y="139" width="24" height="14"/>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tVb-Qq-sU7">
|
||||
<rect key="frame" x="343" y="150" width="24" height="14"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="End" id="He0-rl-DBi">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="249" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="78">
|
||||
<rect key="frame" x="18" y="205" width="107" height="16"/>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="249" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="78">
|
||||
<rect key="frame" x="18" y="218" width="107" height="16"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Window:" id="88">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="logFormatPopup">
|
||||
<rect key="frame" x="128" y="75" width="187" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="logFormatCell">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="message"/>
|
||||
<menu key="menu" id="logFormatMenu"/>
|
||||
</popUpButtonCell>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="180" id="logFormatWidth"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<accessibilityConnection property="title" destination="logFormatLabel" id="logFormatAccessibility"/>
|
||||
<binding destination="-2" name="content" keyPath="logFormatOptions" id="logFormatContentBinding"/>
|
||||
<binding destination="3" name="selectedTag" keyPath="values.SBLogFormat" previousBinding="logFormatContentBinding" id="logFormatBinding"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<button verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="79">
|
||||
<rect key="frame" x="129" y="262" width="126" height="18"/>
|
||||
<rect key="frame" x="129" y="279" width="130" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Show open panel" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="87">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -171,15 +188,15 @@
|
||||
</connections>
|
||||
</button>
|
||||
<popUpButton verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="236">
|
||||
<rect key="frame" x="129" y="108" width="185" height="25"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="180" id="mhj-Zx-MME"/>
|
||||
</constraints>
|
||||
<rect key="frame" x="128" y="119" width="187" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="237">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="238"/>
|
||||
</popUpButtonCell>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="180" id="mhj-Zx-MME"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<accessibilityConnection property="title" destination="206" id="SzO-00-e3U"/>
|
||||
<action selector="updateRatingsCountry:" target="-2" id="242"/>
|
||||
@@ -187,14 +204,22 @@
|
||||
<binding destination="123" name="selectedValue" keyPath="values.SBRatingsCountry" previousBinding="245" id="248"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mNP-6I-gV4">
|
||||
<rect key="frame" x="232" y="139" width="44" height="14"/>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mNP-6I-gV4">
|
||||
<rect key="frame" x="235" y="150" width="44" height="14"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Middle" id="2o1-dB-mt1">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="249" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="logFormatLabel">
|
||||
<rect key="frame" x="18" y="82" width="107" height="16"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Log Format:" id="logFormatLabelCell">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="236" secondAttribute="trailing" constant="20" symbolic="YES" id="1oW-ke-hqe"/>
|
||||
@@ -212,7 +237,7 @@
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="79" secondAttribute="trailing" constant="20" symbolic="YES" id="C2B-fq-5vM"/>
|
||||
<constraint firstItem="81" firstAttribute="leading" secondItem="78" secondAttribute="leading" id="Ctg-6r-Vpm"/>
|
||||
<constraint firstAttribute="bottom" secondItem="136" secondAttribute="bottom" constant="20" symbolic="YES" id="Cxf-3a-EqU"/>
|
||||
<constraint firstItem="133" firstAttribute="top" secondItem="249" secondAttribute="bottom" constant="23" id="DFU-xm-8vq"/>
|
||||
<constraint firstItem="133" firstAttribute="top" secondItem="249" secondAttribute="bottom" constant="37" id="DFU-xm-8vq"/>
|
||||
<constraint firstItem="B5v-6Q-3Qa" firstAttribute="leading" secondItem="79" secondAttribute="leading" id="FJg-U6-HDs"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="B5v-6Q-3Qa" secondAttribute="trailing" constant="20" id="J3X-XR-5sZ"/>
|
||||
<constraint firstItem="82" firstAttribute="leading" secondItem="81" secondAttribute="trailing" constant="8" id="LHd-r8-b8o"/>
|
||||
@@ -241,6 +266,12 @@
|
||||
<constraint firstItem="mNP-6I-gV4" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="XPF-Mh-XYC" secondAttribute="trailing" constant="8" symbolic="YES" id="jyx-OY-6tw"/>
|
||||
<constraint firstItem="133" firstAttribute="firstBaseline" secondItem="139" secondAttribute="firstBaseline" id="kA6-a1-Krp"/>
|
||||
<constraint firstItem="249" firstAttribute="leading" secondItem="236" secondAttribute="leading" id="kh1-gL-cmS"/>
|
||||
<constraint firstItem="logFormatPopup" firstAttribute="firstBaseline" secondItem="logFormatLabel" secondAttribute="firstBaseline" id="logFormatBaseline"/>
|
||||
<constraint firstItem="logFormatLabel" firstAttribute="leading" secondItem="78" secondAttribute="leading" id="logFormatLabelLeading"/>
|
||||
<constraint firstItem="logFormatLabel" firstAttribute="width" secondItem="78" secondAttribute="width" id="logFormatLabelWidth"/>
|
||||
<constraint firstItem="logFormatPopup" firstAttribute="leading" secondItem="logFormatLabel" secondAttribute="trailing" constant="8" id="logFormatLeading"/>
|
||||
<constraint firstItem="logFormatLabel" firstAttribute="top" secondItem="80" secondAttribute="bottom" constant="120" id="logFormatTop"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="logFormatPopup" secondAttribute="trailing" constant="20" symbolic="YES" id="logFormatTrailing"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="249" secondAttribute="trailing" constant="20" symbolic="YES" id="mef-Mj-rvp"/>
|
||||
<constraint firstItem="236" firstAttribute="leading" secondItem="206" secondAttribute="trailing" constant="8" id="n47-AS-gXR"/>
|
||||
<constraint firstItem="80" firstAttribute="leading" secondItem="78" secondAttribute="trailing" constant="8" id="nPD-Zb-eKT"/>
|
||||
|
||||
+32
-14
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23727" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23727"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
@@ -147,12 +147,13 @@
|
||||
<action selector="sendToQueue:" target="-1" id="599"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Send To iTunes" id="597" userLabel="10">
|
||||
<menuItem title="Send To iTunes" keyEquivalent="I" id="597" userLabel="10">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="sendToExternalApp:" target="-1" id="598"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="Wqy-Ps-5Qb"/>
|
||||
<menuItem title="Import" id="544">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Import" id="545">
|
||||
@@ -184,6 +185,23 @@
|
||||
<menuItem isSeparatorItem="YES" id="74" userLabel="2">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Start Queue" keyEquivalent="B" id="TRh-ZN-Id8">
|
||||
<connections>
|
||||
<action selector="toggleStartStop:" target="449" id="ea4-oe-9YQ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Remove completed items from queue" id="Cre-T6-PID">
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
CA
|
||||
</string>
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="removeCompletedItems:" target="-1" id="ouO-db-qWo"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="7Ls-cX-HSz" userLabel="2">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Page Setup..." keyEquivalent="P" id="77" userLabel="5">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
@@ -241,8 +259,8 @@
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="532"/>
|
||||
<menuItem title="Offset…" id="567">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menuItem title="Offset…" keyEquivalent="o" id="567">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES"/>
|
||||
<connections>
|
||||
<action selector="showTrackOffsetSheet:" target="-1" id="570"/>
|
||||
</connections>
|
||||
@@ -309,31 +327,31 @@
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Organize alternate groups" id="652">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menuItem title="Organize alternate groups" keyEquivalent="g" id="652">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES"/>
|
||||
<connections>
|
||||
<action selector="iTunesFriendlyTrackGroups:" target="-1" id="654"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Clear tracks names" id="hKY-N2-NzK">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menuItem title="Clear tracks names" keyEquivalent="n" id="hKY-N2-NzK">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES"/>
|
||||
<connections>
|
||||
<action selector="clearTrackNames:" target="-1" id="KsZ-tN-sdV"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Prettify audio track names" id="fm8-d2-1Yi">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menuItem title="Prettify audio track names" keyEquivalent="p" id="fm8-d2-1Yi">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES"/>
|
||||
<connections>
|
||||
<action selector="prettifyAudioTrackNames:" target="-1" id="z63-Uv-MTO"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Fix audio fallbacks" id="FXb-bX-0Wb">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menuItem title="Fix audio fallbacks" keyEquivalent="f" id="FXb-bX-0Wb">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES"/>
|
||||
<connections>
|
||||
<action selector="fixAudioFallbacks:" target="-1" id="cpY-If-3df"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="568"/>
|
||||
<menuItem isSeparatorItem="YES" id="yw4-pb-tNR"/>
|
||||
<menuItem title="Find" id="218">
|
||||
<menu key="submenu" title="Find" id="220">
|
||||
<items>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="18122" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="18122"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -13,7 +13,7 @@
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="1" customClass="PrefsWindow" customModule="Subler" customModuleProvider="target">
|
||||
<window title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="1" customClass="PrefsWindow" customModule="Subler" customModuleProvider="target">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="625" y="560" width="660" height="220"/>
|
||||
|
||||
+21
-25
@@ -62,38 +62,15 @@ final class DocumentController : NSDocumentController {
|
||||
}
|
||||
|
||||
@NSApplicationMain
|
||||
final class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {
|
||||
|
||||
@IBOutlet weak var sendToExternalApp: NSMenuItem!
|
||||
|
||||
private static func appSupportURL() -> URL {
|
||||
let fileManager = FileManager.default
|
||||
if let url = fileManager.urls(for: .applicationSupportDirectory, in: .userDomainMask)
|
||||
.first?.appendingPathComponent("Subler") {
|
||||
|
||||
do {
|
||||
if fileManager.fileExists(atPath: url.path) == false {
|
||||
try fileManager.createDirectory(at: url, withIntermediateDirectories: true, attributes: [:])
|
||||
}
|
||||
}
|
||||
catch _ {
|
||||
fatalError("Couldn't create the app support directory")
|
||||
}
|
||||
|
||||
return url
|
||||
}
|
||||
else {
|
||||
fatalError("Couldn't find the app support directory")
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor private lazy var prefsController: PrefsWindowController = {
|
||||
return PrefsWindowController()
|
||||
}()
|
||||
|
||||
private lazy var logger: Logger = {
|
||||
return Logger(fileURL: AppDelegate.appSupportURL().appendingPathComponent("debugLog.txt"))
|
||||
}()
|
||||
private let logger = Logger.shared
|
||||
|
||||
@MainActor private lazy var activityWindowController: ActivityWindowController = {
|
||||
return ActivityWindowController(logger: logger)
|
||||
@@ -236,6 +213,25 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
return false
|
||||
}
|
||||
|
||||
@IBAction func toggleStartStop(_ sender: Any?) {
|
||||
QueueController.shared.toggleStartStop(sender)
|
||||
}
|
||||
|
||||
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
||||
let action = menuItem.action
|
||||
|
||||
if action == #selector(toggleStartStop(_:)) {
|
||||
let state = QueueController.shared.status
|
||||
if state == .working {
|
||||
menuItem.title = NSLocalizedString("Stop Queue", comment: "Main Menu -> Stop Queue")
|
||||
} else {
|
||||
menuItem.title = NSLocalizedString("Start Queue", comment: "Main Menu -> Start Queue")
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// MARK: actions
|
||||
|
||||
@IBAction func openInQueue(_ sender: Any) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22690"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -22,6 +22,7 @@
|
||||
<outlet property="setsPopUp" destination="179" id="hl9-DS-qsm"/>
|
||||
<outlet property="tagsPopUp" destination="30" id="1v4-T2-oDW"/>
|
||||
<outlet property="view" destination="1" id="2"/>
|
||||
<outlet property="zoomSlider" destination="235" id="fFP-8i-4SK"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
@@ -131,7 +132,7 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="14" rowSizeStyle="automatic" headerView="qXU-xB-xRF" viewBased="YES" floatsGroupRows="NO" id="qg5-r0-E4V" customClass="ExpandedTableView" customModule="Subler" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="447" height="225"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="446" height="225"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<size key="intercellSpacing" width="3" height="2"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -175,7 +176,7 @@
|
||||
</tableCellView>
|
||||
</prototypeCellViews>
|
||||
</tableColumn>
|
||||
<tableColumn identifier="value" width="314" minWidth="40" maxWidth="4000" id="os0-Yb-exW">
|
||||
<tableColumn identifier="value" width="285" minWidth="40" maxWidth="4000" id="os0-Yb-exW">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Value">
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -188,11 +189,11 @@
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
<prototypeCellViews>
|
||||
<tableCellView identifier="TextCell" id="mjh-te-NdK">
|
||||
<rect key="frame" x="127" y="1" width="318" height="14"/>
|
||||
<rect key="frame" x="127" y="1" width="289" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="T0o-RG-lfn">
|
||||
<rect key="frame" x="0.0" y="0.0" width="318" height="14"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="289" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" id="WRR-52-lxo">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -214,11 +215,11 @@
|
||||
</connections>
|
||||
</tableCellView>
|
||||
<tableCellView identifier="TextCellForSizing" id="OUW-Fk-klv">
|
||||
<rect key="frame" x="127" y="17" width="318" height="14"/>
|
||||
<rect key="frame" x="127" y="17" width="289" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="AmC-rT-7Rf">
|
||||
<rect key="frame" x="0.0" y="0.0" width="318" height="14"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="289" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" id="ipR-OL-rI2">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -237,11 +238,11 @@
|
||||
</connections>
|
||||
</tableCellView>
|
||||
<tableCellView identifier="PopUpCell" id="JEU-aR-J9v" customClass="PopUpCellView" customModule="Subler" customModuleProvider="target">
|
||||
<rect key="frame" x="127" y="33" width="318" height="14"/>
|
||||
<rect key="frame" x="127" y="33" width="289" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="cFv-4U-VzM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="312" height="14"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="283" height="14"/>
|
||||
<popUpButtonCell key="cell" type="bevel" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" imageScaling="proportionallyDown" inset="2" selectedItem="6Zb-NM-Mmo" id="Myn-C3-tc4">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
@@ -266,11 +267,11 @@
|
||||
</connections>
|
||||
</tableCellView>
|
||||
<tableCellView identifier="BoolCell" id="DGy-Nb-PAN" customClass="CheckBoxCellView" customModule="Subler" customModuleProvider="target">
|
||||
<rect key="frame" x="127" y="49" width="318" height="17"/>
|
||||
<rect key="frame" x="127" y="49" width="289" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="oyk-jS-zmh">
|
||||
<rect key="frame" x="2" y="-1" width="314" height="19"/>
|
||||
<rect key="frame" x="2" y="-1" width="285" height="19"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" controlSize="small" state="on" inset="2" id="f5s-ar-fW6">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
@@ -291,11 +292,11 @@
|
||||
</connections>
|
||||
</tableCellView>
|
||||
<tableCellView identifier="ComboCell" id="vy5-48-Vip" customClass="ComboBoxCellView" customModule="Subler" customModuleProvider="target">
|
||||
<rect key="frame" x="127" y="68" width="318" height="17"/>
|
||||
<rect key="frame" x="127" y="68" width="289" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<comboBox focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="1000" translatesAutoresizingMaskIntoConstraints="NO" id="LbC-r6-Pau">
|
||||
<rect key="frame" x="2" y="0.0" width="312" height="19"/>
|
||||
<rect key="frame" x="2" y="0.0" width="283" height="19"/>
|
||||
<comboBoxCell key="cell" controlSize="small" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" alignment="left" usesSingleLineMode="YES" buttonBordered="NO" numberOfVisibleItems="5" id="jkg-xz-Hbn">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -326,7 +327,7 @@
|
||||
</tableView>
|
||||
</subviews>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="tkU-nC-Bdd">
|
||||
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="tkU-nC-Bdd">
|
||||
<rect key="frame" x="1" y="233" width="446" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
@@ -335,7 +336,7 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<tableHeaderView key="headerView" wantsLayer="YES" id="qXU-xB-xRF">
|
||||
<rect key="frame" x="0.0" y="0.0" width="447" height="23"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="446" height="23"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</tableHeaderView>
|
||||
</scrollView>
|
||||
|
||||
@@ -9,6 +9,7 @@ import Cocoa
|
||||
import IOKit.pwr_mgt
|
||||
import MP42Foundation
|
||||
|
||||
@objc(SBDocument)
|
||||
final class Document: NSDocument {
|
||||
|
||||
private(set) var mp4: MP42File
|
||||
@@ -20,6 +21,7 @@ final class Document: NSDocument {
|
||||
self.optimize = false
|
||||
self.unsupportedMp4Brand = false
|
||||
self.mp4 = MP42File()
|
||||
super.init()
|
||||
}
|
||||
|
||||
init(mp4: MP42File) {
|
||||
|
||||
@@ -40,6 +40,13 @@ class DocumentToolbarDelegate: NSObject, NSToolbarDelegate {
|
||||
action: #selector(DocumentWindowController.deleteTrack(_:)))
|
||||
} else if itemIdentifier == .actions {
|
||||
let submenu = NSMenu()
|
||||
|
||||
let menuItem = NSMenuItem()
|
||||
menuItem.title = NSLocalizedString("At the Beginning", comment: "Toolbar")
|
||||
menuItem.action = #selector(DocumentWindowController.addChaptersEvery(_:))
|
||||
menuItem.tag = -1
|
||||
submenu.addItem(menuItem)
|
||||
|
||||
for minutes in [1, 2, 5, 10, 15, 20, 30] {
|
||||
let menuItem = NSMenuItem()
|
||||
let title = minutes == 1 ? NSLocalizedString("1 minute", comment: "Toolbar") :
|
||||
|
||||
@@ -308,12 +308,12 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
|
||||
let minutes = sender.tag * 60 * 1000
|
||||
|
||||
if minutes > 0 {
|
||||
for (index, duration) in stride(from: 0, to: mp4.duration, by: minutes).enumerated() {
|
||||
track.addChapter("Chapter \(index + 1)", duration: UInt64(duration))
|
||||
for (index, timestamp) in stride(from: 0, to: mp4.duration, by: minutes).enumerated() {
|
||||
track.addChapter("Chapter \(index + 1)", timestamp: UInt64(timestamp))
|
||||
}
|
||||
}
|
||||
else {
|
||||
track.addChapter("Chapter 1", duration: UInt64(mp4.duration))
|
||||
track.addChapter("Chapter 1", timestamp: 0)
|
||||
}
|
||||
|
||||
doc.updateChangeCount(.changeDone)
|
||||
@@ -514,6 +514,22 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
|
||||
}
|
||||
}
|
||||
|
||||
@objc func importFilesDirectly(_ fileURLs: [URL]) {
|
||||
do {
|
||||
let controller = try FileImportController(fileURLs: fileURLs, delegate: self)
|
||||
|
||||
// Call addTracks directly - the Settings initialization logic runs when the controller is created
|
||||
controller.addTracks(self)
|
||||
tracksViewController.reloadData()
|
||||
} catch {
|
||||
if let windowForSheet = doc.windowForSheet {
|
||||
presentError(error, modalFor: windowForSheet, delegate: nil, didPresent: nil, contextInfo: nil)
|
||||
} else {
|
||||
presentError(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func didSelect(tracks: [MP42Track], metadata: MP42Metadata?) {
|
||||
for track in tracks {
|
||||
mp4.addTrack(track)
|
||||
|
||||
@@ -329,6 +329,8 @@ final class FileImportController: ViewController, NSTableViewDataSource, NSTable
|
||||
}
|
||||
|
||||
@IBAction func addTracks(_ sender: Any) {
|
||||
logTracksTable()
|
||||
|
||||
var selectedTracks: [MP42Track] = []
|
||||
|
||||
for trackSettings in settings where trackSettings.checked {
|
||||
@@ -521,4 +523,78 @@ final class FileImportController: ViewController, NSTableViewDataSource, NSTable
|
||||
return 18
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Private methods
|
||||
|
||||
private func logTracksTable() {
|
||||
let logger = Logger.shared
|
||||
|
||||
// Helper function to truncate strings
|
||||
func truncate(_ str: String, to length: Int) -> String {
|
||||
if str.count <= length {
|
||||
return str.padding(toLength: length, withPad: " ", startingAt: 0)
|
||||
}
|
||||
return String(str.prefix(length - 1)) + "~"
|
||||
}
|
||||
|
||||
// Helper function to format duration
|
||||
func formatDuration(_ duration: Double, timescale: UInt32) -> String {
|
||||
if duration <= 0 || timescale == 0 {
|
||||
return "Unknown"
|
||||
}
|
||||
let seconds = duration / Double(timescale)
|
||||
let hours = Int(seconds) / 3600
|
||||
let minutes = (Int(seconds) % 3600) / 60
|
||||
let secs = Int(seconds) % 60
|
||||
let millisecs = Int((seconds - Double(Int(seconds))) * 1000)
|
||||
return String(format: "%02d:%02d:%02d.%03d", hours, minutes, secs, millisecs)
|
||||
}
|
||||
|
||||
// Build the entire table as a single string
|
||||
var tableLines: [String] = []
|
||||
|
||||
tableLines.append("File Import: Processing tracks with applied settings:")
|
||||
tableLines.append("----------------------------------------------------------------------------------------------")
|
||||
tableLines.append("| | Id | Name | Duration | Language | Info | Action |")
|
||||
tableLines.append("----------------------------------------------------------------------------------------------")
|
||||
|
||||
var trackId = 1
|
||||
for item in items {
|
||||
switch item {
|
||||
case .file(_):
|
||||
// Skip file headers in table format
|
||||
break
|
||||
|
||||
case .track(let settings):
|
||||
let track = settings.track
|
||||
|
||||
// Get the selected action description
|
||||
let selectedAction = settings.actions.first { $0.tag == settings.selectedActionTag }
|
||||
let action = selectedAction?.title ?? "Unknown"
|
||||
|
||||
// Format the data with proper truncation and alignment
|
||||
let name = truncate(track.name.isEmpty ? "Unnamed" : track.name, to: 21)
|
||||
let language = truncate(MP42Languages.defaultManager.localizedLang(forExtendedTag: track.language), to: 13)
|
||||
let infoTruncated = truncate(track.formatSummary, to: 10)
|
||||
let actionTruncated = truncate(action, to: 13)
|
||||
let duration = formatDuration(Double(track.duration), timescale: track.timescale)
|
||||
let selected = settings.checked ? "X" : " "
|
||||
let id = String(format: "%02d", trackId)
|
||||
|
||||
// Create properly aligned row with fixed column widths
|
||||
// The truncate function now handles padding, so we just need to pad duration
|
||||
let durationPadded = duration.padding(toLength: 12, withPad: " ", startingAt: 0)
|
||||
|
||||
let row = "| \(selected) | \(id) | \(name) | \(durationPadded) | \(language) | \(infoTruncated) | \(actionTruncated) |"
|
||||
tableLines.append(row)
|
||||
|
||||
trackId += 1
|
||||
}
|
||||
}
|
||||
|
||||
tableLines.append("----------------------------------------------------------------------------------------------")
|
||||
|
||||
// Log the entire table as a single entry
|
||||
logger.write(toLog: tableLines.joined(separator: "\n"))
|
||||
}
|
||||
}
|
||||
@@ -37,4 +37,11 @@ class GeneralPrefsViewController: NSViewController {
|
||||
|
||||
@objc dynamic var ratingsCountries: [String] { return Ratings.shared.countries.map { $0.displayName } }
|
||||
|
||||
@objc dynamic var logFormatOptions: [String] {
|
||||
return [
|
||||
"Time Only",
|
||||
"Date and Time"
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
+51
-3
@@ -10,7 +10,15 @@ import MP42Foundation
|
||||
|
||||
final class Logger : NSObject, MP42Logging {
|
||||
|
||||
enum Format: Int {
|
||||
case timeOnly = 0
|
||||
case dateAndTime = 1
|
||||
}
|
||||
|
||||
static let shared = Logger(fileURL: defaultDestinationURL)
|
||||
|
||||
var delegate: MP42Logging?
|
||||
var format: Format { Format(rawValue: Prefs.logFormat) ?? .timeOnly }
|
||||
|
||||
private let fileURL: URL
|
||||
private let queue: DispatchQueue
|
||||
@@ -24,7 +32,17 @@ final class Logger : NSObject, MP42Logging {
|
||||
var currentTime = time(nil)
|
||||
if let localTime = localtime(¤tTime) {
|
||||
let p = localTime.pointee
|
||||
return "\(p.tm_hour):\(p.tm_min):\(p.tm_sec)"
|
||||
return String(format: "%02d:%02d:%02d", p.tm_hour, p.tm_min, p.tm_sec)
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
private func currentDate() -> String {
|
||||
var currentTime = time(nil)
|
||||
if let localTime = localtime(¤tTime) {
|
||||
let p = localTime.pointee
|
||||
return String(format: "%04d-%02d-%02d", p.tm_year + 1900, p.tm_mon + 1, p.tm_mday)
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
@@ -32,7 +50,14 @@ final class Logger : NSObject, MP42Logging {
|
||||
|
||||
func write(toLog string: String) {
|
||||
queue.sync {
|
||||
let output = "\(currentTime()) \(string)\n"
|
||||
let prefix: String
|
||||
switch format {
|
||||
case .timeOnly:
|
||||
prefix = currentTime()
|
||||
case .dateAndTime:
|
||||
prefix = "\(currentDate()) \(currentTime())"
|
||||
}
|
||||
let output = "\(prefix) \(string)\n"
|
||||
|
||||
fileURL.withUnsafeFileSystemRepresentation {
|
||||
if let file = fopen($0, "a") {
|
||||
@@ -40,7 +65,7 @@ final class Logger : NSObject, MP42Logging {
|
||||
fclose(file)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if let delegate = delegate {
|
||||
delegate.write(toLog: output)
|
||||
}
|
||||
@@ -55,5 +80,28 @@ final class Logger : NSObject, MP42Logging {
|
||||
try? FileManager.default.removeItem(at: fileURL)
|
||||
}
|
||||
|
||||
private static let defaultDestinationURL: URL = {
|
||||
appSupportURL().appendingPathComponent("debugLog.txt")
|
||||
}()
|
||||
|
||||
private static func appSupportURL() -> URL {
|
||||
let fileManager = FileManager.default
|
||||
if let url = fileManager.urls(for: .applicationSupportDirectory, in: .userDomainMask)
|
||||
.first?.appendingPathComponent("Subler") {
|
||||
|
||||
do {
|
||||
if fileManager.fileExists(atPath: url.path) == false {
|
||||
try fileManager.createDirectory(at: url, withIntermediateDirectories: true, attributes: [:])
|
||||
}
|
||||
}
|
||||
catch _ {
|
||||
fatalError("Couldn't create the app support directory")
|
||||
}
|
||||
|
||||
return url
|
||||
}
|
||||
else {
|
||||
fatalError("Couldn't find the app support directory")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,8 +83,8 @@ public enum ArtworkType : Int, CustomStringConvertible {
|
||||
case season
|
||||
case episode
|
||||
case backdrop
|
||||
case person
|
||||
case none
|
||||
case person = 5
|
||||
case none = 4
|
||||
}
|
||||
|
||||
public struct Artwork: Equatable, Hashable {
|
||||
@@ -159,7 +159,8 @@ private let localizedKeys: [MetadataResult.Key: String] = [
|
||||
.network : NSLocalizedString("Network", comment: "nil"),
|
||||
|
||||
.serviceSeriesID : NSLocalizedString("Service ID", comment: "nil"),
|
||||
.serviceEpisodeID : NSLocalizedString("Service ID", comment: "nil")
|
||||
.serviceAdditionalSeriesID : NSLocalizedString("Service Additional ID", comment: "nil"),
|
||||
.serviceEpisodeID : NSLocalizedString("Service Episode ID", comment: "nil")
|
||||
]
|
||||
|
||||
public final class MetadataResult {
|
||||
@@ -201,10 +202,10 @@ public final class MetadataResult {
|
||||
case season = "{Season}"
|
||||
case network = "{Network}"
|
||||
|
||||
//
|
||||
case serviceSeriesID = "ServiceSeriesID"
|
||||
case serviceAdditionalSeriesID = "AdditionalServiceSeriesID"
|
||||
case serviceEpisodeID = "ServiceEpisodeID"
|
||||
// Services internal IDs
|
||||
case serviceSeriesID = "{ServiceSeriesID}"
|
||||
case serviceAdditionalSeriesID = "{AdditionalServiceSeriesID}"
|
||||
case serviceEpisodeID = "{ServiceEpisodeID}"
|
||||
|
||||
fileprivate static var movieKeys: [Key] {
|
||||
return [.name,
|
||||
@@ -223,7 +224,11 @@ public final class MetadataResult {
|
||||
.copyright,
|
||||
.contentID,
|
||||
.artistID,
|
||||
.iTunesCountry]
|
||||
.iTunesCountry,
|
||||
|
||||
.serviceSeriesID,
|
||||
.serviceAdditionalSeriesID,
|
||||
.serviceEpisodeID]
|
||||
}
|
||||
|
||||
fileprivate static var tvShowKeys: [Key] {
|
||||
@@ -256,6 +261,10 @@ public final class MetadataResult {
|
||||
.artistID,
|
||||
.playlistID,
|
||||
.iTunesCountry,
|
||||
|
||||
.serviceSeriesID,
|
||||
.serviceAdditionalSeriesID,
|
||||
.serviceEpisodeID
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
+9
-2
@@ -77,7 +77,8 @@ enum Prefs {
|
||||
_defaultSaveFormat, _organizeAlternateGroups, _inferMediaCharacteristics, _audioMixdown,
|
||||
_audioBitrate, _audioDRC, _audioConvertAC3, _audioKeepAC3, _audioConvertDts,
|
||||
_audioDtsOptions, _subtitleConvertBitmap, _ratingsCountry, _chaptersPreviewPosition,
|
||||
_chaptersPreviewTrack, _mp464bitOffset, _mp464bitTimes, _mp4SaveAsOptimize, _forceHvc1])
|
||||
_chaptersPreviewTrack, _mp464bitOffset, _mp464bitTimes, _mp4SaveAsOptimize, _forceHvc1,
|
||||
_logFormat])
|
||||
}
|
||||
|
||||
@Stored(key: "NSApplicationCrashOnException", defaultValue: true)
|
||||
@@ -155,8 +156,14 @@ enum Prefs {
|
||||
@Stored(key: "SBArtworkSelectorZoomLevel", defaultValue: 50)
|
||||
static var artworkSelectorZoomLevel: Float
|
||||
|
||||
@Stored(key: "SBMoviewArtworkSelectorZoomLevel", defaultValue: 50)
|
||||
@Stored(key: "SBMovieArtworkSelectorZoomLevel", defaultValue: 50)
|
||||
static var movieArtworkSelectorZoomLevel: Float
|
||||
|
||||
@Stored(key: "SBPresetArtworkSelectorZoomLevel", defaultValue: 0)
|
||||
static var presetArtworkSelectorZoomLevel: Float
|
||||
|
||||
@Stored(key: "SBLogFormat", defaultValue: 0)
|
||||
static var logFormat: Int // 0 = Time Only, 1 = Date and Time
|
||||
}
|
||||
|
||||
enum MetadataPrefs {
|
||||
|
||||
@@ -104,6 +104,7 @@ class PrefsWindowController: NSWindowController, NSWindowDelegate {
|
||||
}, completionHandler: {
|
||||
view.isHidden = false
|
||||
window.title = item.label
|
||||
self.window?.makeFirstResponder(view.nextKeyView)
|
||||
})
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -42,6 +42,15 @@ final class PresetEditorViewController: MovieViewController {
|
||||
replaceAnnotations.state = preset.replaceAnnotations == false ? .on : .off
|
||||
}
|
||||
|
||||
override var zoomLevel: Float {
|
||||
get {
|
||||
Prefs.presetArtworkSelectorZoomLevel
|
||||
}
|
||||
set (value) {
|
||||
Prefs.presetArtworkSelectorZoomLevel = value;
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func done(_ sender: Any) {
|
||||
presentingViewController?.dismiss(self)
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ final class ChapterViewController : PropertyView, NSTableViewDataSource, NSTable
|
||||
}
|
||||
|
||||
@IBAction func addChapter(_ sender: Any) {
|
||||
track.addChapter("Chapter", duration: 0)
|
||||
track.addChapter("Chapter", timestamp: 0)
|
||||
|
||||
tableView.reloadData()
|
||||
updateChangeCount()
|
||||
|
||||
@@ -137,7 +137,7 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
|
||||
}
|
||||
|
||||
override func viewWillAppear() {
|
||||
let zoomValue = Prefs.movieArtworkSelectorZoomLevel
|
||||
let zoomValue = zoomLevel
|
||||
setZoomValue(zoomValue)
|
||||
zoomSlider.floatValue = zoomValue
|
||||
}
|
||||
@@ -1262,6 +1262,15 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
|
||||
}
|
||||
}
|
||||
|
||||
var zoomLevel: Float {
|
||||
get {
|
||||
Prefs.movieArtworkSelectorZoomLevel
|
||||
}
|
||||
set (value) {
|
||||
Prefs.movieArtworkSelectorZoomLevel = value;
|
||||
}
|
||||
}
|
||||
|
||||
private func setZoomValue(_ newZoomValue: Float) {
|
||||
if let layout = artworksView.collectionViewLayout as? NSCollectionViewFlowLayout {
|
||||
if newZoomValue == 50 {
|
||||
@@ -1281,7 +1290,7 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
|
||||
|
||||
@IBAction func zoomSliderDidChange(_ sender: NSControl) {
|
||||
setZoomValue(sender.floatValue)
|
||||
Prefs.movieArtworkSelectorZoomLevel = sender.floatValue
|
||||
zoomLevel = sender.floatValue
|
||||
}
|
||||
|
||||
func collectionViewDelete(in collectionView: NSCollectionView) {
|
||||
|
||||
@@ -28,6 +28,8 @@ final class Queue {
|
||||
|
||||
private let url: URL
|
||||
|
||||
private let logger = Logger.shared
|
||||
|
||||
enum Status {
|
||||
case unknown
|
||||
case working
|
||||
@@ -157,9 +159,12 @@ final class Queue {
|
||||
let result = self.process(currentItem)
|
||||
if .completed == result {
|
||||
completed += 1
|
||||
self.logger.write(toLog: currentItem.fileURL.lastPathComponent + " completed")
|
||||
} else if .failed == result {
|
||||
failed += 1
|
||||
self.logger.write(toLog: currentItem.fileURL.lastPathComponent + " failed")
|
||||
} else if .cancelled == result {
|
||||
self.logger.write(toLog: currentItem.fileURL.lastPathComponent + " cancelled")
|
||||
break
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -45,3 +45,27 @@ import Foundation
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@objc(SBQueueRemoveCompletedScriptCommand) class QueueRemoveCompletedScriptCommand: NSScriptCommand {
|
||||
|
||||
@MainActor override func performDefaultImplementation() -> Any? {
|
||||
QueueController.shared.removeCompletedItems(self)
|
||||
return nil
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@objc(SBQueueStatusScriptCommand) class SBQueueStatusScriptCommand: NSScriptCommand {
|
||||
|
||||
@MainActor override func performDefaultImplementation() -> Any? {
|
||||
switch QueueController.shared.status {
|
||||
case .unknown:
|
||||
return 0 // idle
|
||||
case .working:
|
||||
return 1 // running
|
||||
case .completed:
|
||||
return 2 // completed
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
import Cocoa
|
||||
import MP42Foundation
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
final class SaveOptions: NSViewController {
|
||||
|
||||
@@ -46,13 +47,22 @@ final class SaveOptions: NSViewController {
|
||||
fileFormat.addItem(withTitle: name)
|
||||
}
|
||||
|
||||
fileFormat.selectItem(at: Prefs.defaultSaveFormat)
|
||||
savePanel?.allowedFileTypes = [Prefs.saveFormat]
|
||||
let idx = Prefs.defaultSaveFormat > -1 && Prefs.defaultSaveFormat < formats.count ? Prefs.defaultSaveFormat : 1
|
||||
let format = formats[idx]
|
||||
|
||||
fileFormat.selectItem(at: idx)
|
||||
|
||||
if let filename = doc.mp4.preferredFileName() {
|
||||
savePanel?.nameFieldStringValue = filename
|
||||
}
|
||||
|
||||
if #available(macOS 15.0, *) {
|
||||
let type = UTType(format) ?? .mpeg4Movie
|
||||
savePanel?.currentContentType = type
|
||||
} else {
|
||||
savePanel?.allowedFileTypes = [Prefs.saveFormat]
|
||||
}
|
||||
|
||||
_64bit_data.state = Prefs.mp464bitOffset ? .on : .off
|
||||
_64bit_time.state = Prefs.mp464bitTimes ? .on : .off
|
||||
optimize.state = Prefs.mp4SaveAsOptimize ? .on : .off
|
||||
@@ -62,8 +72,7 @@ final class SaveOptions: NSViewController {
|
||||
}
|
||||
}
|
||||
|
||||
func saveUserDefaults()
|
||||
{
|
||||
func saveUserDefaults() {
|
||||
Prefs.defaultSaveFormat = fileFormat.indexOfSelectedItem
|
||||
Prefs.mp464bitOffset = _64bit_data.state == .on
|
||||
Prefs.mp464bitTimes = _64bit_time.state == .on
|
||||
@@ -91,7 +100,12 @@ final class SaveOptions: NSViewController {
|
||||
default:
|
||||
break
|
||||
}
|
||||
savePanel?.allowedFileTypes = [requiredFileType]
|
||||
if #available(macOS 15.0, *) {
|
||||
let type = UTType(filenameExtension: requiredFileType) ?? .mpeg4Movie
|
||||
savePanel?.currentContentType = type
|
||||
} else {
|
||||
savePanel?.allowedFileTypes = [requiredFileType]
|
||||
}
|
||||
Prefs.saveFormat = requiredFileType
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,875 @@
|
||||
//
|
||||
// ScriptCommand.swift
|
||||
// Subler
|
||||
//
|
||||
// Created by Michael Mock on 6/9/25.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import MP42Foundation
|
||||
|
||||
// Protocol for universal document targeting
|
||||
protocol ScriptCommandDocumentTargeting {}
|
||||
extension ScriptCommandDocumentTargeting where Self: NSScriptCommand {
|
||||
func targetedDocument() -> Document? {
|
||||
// First, check for explicit document parameters ('into' or 'doc')
|
||||
if let evaluatedArgs = self.evaluatedArguments {
|
||||
if let doc = evaluatedArgs["into"] as? Document {
|
||||
return doc
|
||||
}
|
||||
if let doc = evaluatedArgs["doc"] as? Document {
|
||||
return doc
|
||||
}
|
||||
}
|
||||
|
||||
// Then, try to get document from direct parameter
|
||||
if let directParameter = self.directParameter as? Document {
|
||||
return directParameter
|
||||
}
|
||||
|
||||
// Then, try to get document from receiver specifier (window targeting)
|
||||
if let receiver = self.receiversSpecifier?.objectsByEvaluatingSpecifier as? Document {
|
||||
return receiver
|
||||
}
|
||||
|
||||
// If receiver is a window, get its document
|
||||
if let window = self.receiversSpecifier?.objectsByEvaluatingSpecifier as? NSWindow,
|
||||
let windowController = window.windowController as? DocumentWindowController {
|
||||
return windowController.document as? Document
|
||||
}
|
||||
|
||||
// Finally, fall back to current document (frontmost)
|
||||
return NSDocumentController.shared.currentDocument as? Document
|
||||
}
|
||||
|
||||
func extractFilePath() -> String? {
|
||||
// Try different ways AppleScript might pass a file path
|
||||
if let param = self.directParameter as? String {
|
||||
return param
|
||||
} else if let fileURL = self.directParameter as? URL {
|
||||
return fileURL.path
|
||||
} else if let fileDescriptor = self.directParameter as? [String: Any],
|
||||
let path = fileDescriptor["path"] as? String {
|
||||
return path
|
||||
} else if let specifier = self.directParameter as? NSScriptObjectSpecifier {
|
||||
// Handle AppleScript file references like POSIX file
|
||||
return specifier.key
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@objc(SBImportFileScriptCommand)
|
||||
class SBImportFileScriptCommand: NSScriptCommand, ScriptCommandDocumentTargeting {
|
||||
|
||||
override func performDefaultImplementation() -> Any? {
|
||||
let logger = Logger.shared
|
||||
|
||||
// Get file path using the helper method
|
||||
guard let path = extractFilePath() else {
|
||||
logger.write(toLog: "Script failed to get file parameter - expected file reference or path string")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Get target document using universal method
|
||||
guard let doc = targetedDocument() else {
|
||||
logger.write(toLog: "No document available for import")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Perform import into the target document
|
||||
let fileURL = URL(fileURLWithPath: path)
|
||||
|
||||
// Import directly into the target document
|
||||
if let windowController = doc.windowControllers.first {
|
||||
let selector = NSSelectorFromString("importFilesDirectly:")
|
||||
if windowController.responds(to: selector) {
|
||||
let fileURLs = [fileURL]
|
||||
_ = windowController.perform(selector, with: fileURLs)
|
||||
logger.write(toLog: "Script successfully imported file into target document")
|
||||
} else {
|
||||
logger.write(toLog: "importFilesDirectly method not found on target document")
|
||||
}
|
||||
} else {
|
||||
logger.write(toLog: "No window controller found for target document")
|
||||
}
|
||||
|
||||
return path
|
||||
}
|
||||
}
|
||||
|
||||
@objc(SBFetchMetadataScriptCommand)
|
||||
class SBFetchMetadataScriptCommand: NSScriptCommand, ScriptCommandDocumentTargeting {
|
||||
|
||||
override func performDefaultImplementation() -> Any? {
|
||||
let logger = Logger.shared
|
||||
guard let sublerDoc = targetedDocument() else {
|
||||
logger.write(toLog: "No document available for fetching metadata")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Access the MP42File through the custom Document subclass
|
||||
let mp4File = sublerDoc.mp4
|
||||
let searchTerms = mp4File.extractSearchTerms(fallbackURL: sublerDoc.fileURL)
|
||||
|
||||
// Perform headless metadata search with completion handling
|
||||
searchMetadata(terms: searchTerms) { metadata in
|
||||
DispatchQueue.main.async {
|
||||
if let metadata = metadata {
|
||||
// Apply the metadata to the file
|
||||
mp4File.metadata.merge(metadata)
|
||||
sublerDoc.updateChangeCount(.changeDone)
|
||||
|
||||
// Trigger UI refresh by calling reloadData on the window controller
|
||||
if let windowController = sublerDoc.windowControllers.first as? DocumentWindowController {
|
||||
windowController.reloadData()
|
||||
}
|
||||
|
||||
// Log the metadata that was applied
|
||||
let metadataCount = mp4File.metadata.items.count
|
||||
logger.write(toLog: "Script successfully applied \(metadataCount) metadata items")
|
||||
} else {
|
||||
logger.write(toLog: "No metadata found")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
private func searchMetadata(terms: MetadataSearchTerms, completion: @escaping (MP42Metadata?) -> Void) {
|
||||
var metadata: MetadataResult? = nil
|
||||
|
||||
// Use default services and settings
|
||||
let movieService = MetadataSearch.defaultMovieService
|
||||
let tvShowService = MetadataSearch.defaultTVService
|
||||
|
||||
// Get user preferences for artwork from Queue preferences
|
||||
let queuePrefs = QueuePreferences()
|
||||
let preferredArtwork = ArtworkType(rawValue: queuePrefs.providerArtwork) ?? .poster
|
||||
let preferredArtworkSize = ArtworkSize(rawValue: queuePrefs.providerArtworkSize) ?? .standard
|
||||
|
||||
switch terms {
|
||||
case let .movie(title):
|
||||
let movieSearch = MetadataSearch.movieSeach(service: movieService, movie: title, language: MetadataSearch.defaultLanguage(service: movieService, type: .movie))
|
||||
_ = movieSearch.search(completionHandler: { results in
|
||||
if let result = results.first {
|
||||
_ = movieSearch.loadAdditionalMetadata(result, completionHandler: { additionalMetadata in
|
||||
metadata = additionalMetadata
|
||||
|
||||
// Handle artwork similar to QueueMetadataAction
|
||||
if let metadataResult = metadata {
|
||||
let artworks = metadataResult.remoteArtworks
|
||||
|
||||
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) {
|
||||
return artwork
|
||||
} else if let artwork = artworks.filter(by: .poster, size: .standard, service: movieService.name) {
|
||||
return artwork
|
||||
} else {
|
||||
return artworks.first
|
||||
}
|
||||
}()
|
||||
|
||||
// Load and add artwork to metadata result BEFORE mapping
|
||||
if let url = artwork?.url, let artworkData = URLSession.data(from: url) {
|
||||
let mp42Image = MP42Image(data: artworkData, type: MP42_ART_JPEG)
|
||||
metadataResult.artworks.append(mp42Image)
|
||||
}
|
||||
}
|
||||
|
||||
// Map the metadata using the same logic as QueueAction (now includes artwork)
|
||||
let map = metadataResult.mediaKind == .movie ? MetadataPrefs.movieResultMap : MetadataPrefs.tvShowResultMap
|
||||
let mappedMetadata = metadataResult.mappedMetadata(to: map, keepEmptyKeys: false)
|
||||
completion(mappedMetadata)
|
||||
} else {
|
||||
completion(nil)
|
||||
}
|
||||
}).run()
|
||||
} else {
|
||||
completion(nil)
|
||||
}
|
||||
}).run()
|
||||
|
||||
case let .tvShow(seriesName, season, episode):
|
||||
let tvSearch = MetadataSearch.tvSearch(service: tvShowService, tvShow: seriesName, season: season, episode: episode, language: MetadataSearch.defaultLanguage(service: tvShowService, type: .tvShow))
|
||||
_ = tvSearch.search(completionHandler: { results in
|
||||
if let result = results.first {
|
||||
_ = tvSearch.loadAdditionalMetadata(result, completionHandler: { additionalMetadata in
|
||||
metadata = additionalMetadata
|
||||
|
||||
// Handle artwork similar to QueueMetadataAction
|
||||
if let metadataResult = metadata {
|
||||
let artworks = metadataResult.remoteArtworks
|
||||
|
||||
if preferredArtwork != .none && artworks.isEmpty == false {
|
||||
let artwork: Artwork? = {
|
||||
if let artwork = artworks.filter(by: preferredArtwork, size: preferredArtworkSize, service: tvShowService.name) {
|
||||
return artwork
|
||||
} else if let artwork = artworks.filter(by: .season, size: preferredArtworkSize, service: tvShowService.name) {
|
||||
return artwork
|
||||
} else if let artwork = artworks.filter(by: .poster, size: .standard, service: tvShowService.name) {
|
||||
return artwork
|
||||
} else {
|
||||
return artworks.first
|
||||
}
|
||||
}()
|
||||
|
||||
// Load and add artwork to metadata result BEFORE mapping
|
||||
if let url = artwork?.url, let artworkData = URLSession.data(from: url) {
|
||||
let mp42Image = MP42Image(data: artworkData, type: MP42_ART_JPEG)
|
||||
metadataResult.artworks.append(mp42Image)
|
||||
}
|
||||
}
|
||||
|
||||
// Map the metadata using the same logic as QueueAction (now includes artwork)
|
||||
let map = metadataResult.mediaKind == .movie ? MetadataPrefs.movieResultMap : MetadataPrefs.tvShowResultMap
|
||||
let mappedMetadata = metadataResult.mappedMetadata(to: map, keepEmptyKeys: false)
|
||||
completion(mappedMetadata)
|
||||
} else {
|
||||
completion(nil)
|
||||
}
|
||||
}).run()
|
||||
} else {
|
||||
completion(nil)
|
||||
}
|
||||
}).run()
|
||||
|
||||
case .none:
|
||||
completion(nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc(SBOrganizeAlternateGroupsScriptCommand)
|
||||
class SBOrganizeAlternateGroupsScriptCommand: NSScriptCommand, ScriptCommandDocumentTargeting {
|
||||
|
||||
override func performDefaultImplementation() -> Any? {
|
||||
let logger = Logger.shared
|
||||
guard let sublerDoc = targetedDocument() else {
|
||||
logger.write(toLog: "No document available for organizing alternate groups")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Use the existing IBAction instead of duplicating logic
|
||||
if let windowController = sublerDoc.windowControllers.first as? DocumentWindowController {
|
||||
windowController.iTunesFriendlyTrackGroups(self)
|
||||
logger.write(toLog: "Script successfully organized alternate groups")
|
||||
} else {
|
||||
logger.write(toLog: "No window controller found for organizing alternate groups")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@objc(SBClearTrackNamesScriptCommand)
|
||||
class SBClearTrackNamesScriptCommand: NSScriptCommand, ScriptCommandDocumentTargeting {
|
||||
|
||||
override func performDefaultImplementation() -> Any? {
|
||||
let logger = Logger.shared
|
||||
guard let sublerDoc = targetedDocument() else {
|
||||
logger.write(toLog: "No document available for clearing track names")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Use the existing IBAction instead of duplicating logic
|
||||
if let windowController = sublerDoc.windowControllers.first as? DocumentWindowController {
|
||||
windowController.clearTrackNames(self)
|
||||
logger.write(toLog: "Script successfully cleared all track names")
|
||||
} else {
|
||||
logger.write(toLog: "No window controller found for clearing track names")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@objc(SBPrettifyAudioTrackNamesScriptCommand)
|
||||
class SBPrettifyAudioTrackNamesScriptCommand: NSScriptCommand, ScriptCommandDocumentTargeting {
|
||||
|
||||
override func performDefaultImplementation() -> Any? {
|
||||
let logger = Logger.shared
|
||||
guard let sublerDoc = targetedDocument() else {
|
||||
logger.write(toLog: "No document available for prettifying audio track names")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Use the existing IBAction instead of duplicating logic
|
||||
if let windowController = sublerDoc.windowControllers.first as? DocumentWindowController {
|
||||
windowController.prettifyAudioTrackNames(self)
|
||||
logger.write(toLog: "Script successfully prettified audio track names")
|
||||
} else {
|
||||
logger.write(toLog: "No window controller found for prettifying audio track names")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@objc(SBFixAudioFallbacksScriptCommand)
|
||||
class SBFixAudioFallbacksScriptCommand: NSScriptCommand, ScriptCommandDocumentTargeting {
|
||||
|
||||
override func performDefaultImplementation() -> Any? {
|
||||
let logger = Logger.shared
|
||||
guard let sublerDoc = targetedDocument() else {
|
||||
logger.write(toLog: "No document available for fixing audio fallbacks")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Use the existing IBAction instead of duplicating logic
|
||||
if let windowController = sublerDoc.windowControllers.first as? DocumentWindowController {
|
||||
windowController.fixAudioFallbacks(self)
|
||||
logger.write(toLog: "Script successfully fixed audio fallbacks")
|
||||
} else {
|
||||
logger.write(toLog: "No window controller found for fixing audio fallbacks")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@objc(SBSaveAsScriptCommand)
|
||||
class SBSaveAsScriptCommand: NSScriptCommand, ScriptCommandDocumentTargeting {
|
||||
|
||||
override func performDefaultImplementation() -> Any? {
|
||||
let logger = Logger.shared
|
||||
|
||||
// Get the target document (frontmost or specified)
|
||||
guard let sublerDoc = targetedDocument() else {
|
||||
logger.write(toLog: "No document available for save as operation")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Use the helper method to extract the destination path
|
||||
guard let path = extractFilePath() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
let destinationURL = URL(fileURLWithPath: path)
|
||||
let fileName = destinationURL.lastPathComponent
|
||||
|
||||
// Build options dictionary with 64-bit settings from UI preferences
|
||||
var options: [String: Any] = [:]
|
||||
options[MP4264BitData] = Prefs.mp464bitOffset
|
||||
options[MP4264BitTime] = Prefs.mp464bitTimes
|
||||
|
||||
// Get the window controller for progress reporting
|
||||
guard let windowController = sublerDoc.windowControllers.first as? DocumentWindowController else {
|
||||
logger.write(toLog: "No window controller found for progress reporting")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Start progress reporting to show the save modal
|
||||
windowController.startProgressReporting()
|
||||
windowController.setProgress(title: NSLocalizedString("Saving…", comment: "Document Save sheet."))
|
||||
|
||||
// Perform the save operation asynchronously to keep UI responsive
|
||||
DispatchQueue.global(qos: .userInitiated).async {
|
||||
do {
|
||||
try sublerDoc.mp4.write(to: destinationURL, options: options)
|
||||
|
||||
DispatchQueue.main.async {
|
||||
|
||||
// Optimize if requested in UI save dialog preferences
|
||||
if Prefs.mp4SaveAsOptimize {
|
||||
windowController.setProgress(title: NSLocalizedString("Optimizing…", comment: "Document Optimize sheet."))
|
||||
|
||||
// Run optimization on background queue
|
||||
DispatchQueue.global(qos: .userInitiated).async {
|
||||
_ = sublerDoc.mp4.optimize()
|
||||
|
||||
DispatchQueue.main.async {
|
||||
|
||||
// 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()
|
||||
}
|
||||
}
|
||||
} 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()
|
||||
}
|
||||
}
|
||||
logger.write(toLog: "Script save of \(fileName) completed")
|
||||
} catch {
|
||||
DispatchQueue.main.async {
|
||||
// End progress reporting on error
|
||||
windowController.endProgressReporting()
|
||||
logger.write(toLog: "Failed to save document: \(error.localizedDescription)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return path
|
||||
}
|
||||
}
|
||||
|
||||
@objc(SBSendToQueueScriptCommand)
|
||||
class SBSendToQueueScriptCommand: NSScriptCommand, ScriptCommandDocumentTargeting {
|
||||
|
||||
override func performDefaultImplementation() -> Any? {
|
||||
let logger = Logger.shared
|
||||
|
||||
// Get the target document (frontmost or specified)
|
||||
guard let sublerDoc = targetedDocument() else {
|
||||
logger.write(toLog: "No document available for send to queue operation")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Use the helper method to extract the destination path
|
||||
guard let path = extractFilePath() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
let destinationURL = URL(fileURLWithPath: path)
|
||||
let fileName = destinationURL.lastPathComponent
|
||||
|
||||
// Build options dictionary with 64-bit settings from UI preferences
|
||||
var options: [String: Any] = [:]
|
||||
options[MP4264BitData] = Prefs.mp464bitOffset
|
||||
options[MP4264BitTime] = Prefs.mp464bitTimes
|
||||
|
||||
// Create queue item and add to queue
|
||||
let item = QueueItem(mp4: sublerDoc.mp4, destURL: destinationURL, attributes: options, optimize: Prefs.mp4SaveAsOptimize)
|
||||
|
||||
// Add the queue item
|
||||
QueueController.shared.add(item)
|
||||
logger.write(toLog: "Script successfully sent document to queue: \(fileName)")
|
||||
|
||||
// Close the document window since it's now in the queue
|
||||
DispatchQueue.main.async {
|
||||
sublerDoc.close()
|
||||
}
|
||||
|
||||
return path
|
||||
}
|
||||
}
|
||||
|
||||
@objc(SBCloseFileScriptCommand)
|
||||
class SBCloseFileScriptCommand: NSScriptCommand, ScriptCommandDocumentTargeting {
|
||||
|
||||
override func performDefaultImplementation() -> Any? {
|
||||
let logger = Logger.shared
|
||||
|
||||
// Get the target document (frontmost or specified)
|
||||
guard let sublerDoc = targetedDocument() else {
|
||||
logger.write(toLog: "No document available for close operation")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Close the document without prompting for unsaved changes
|
||||
DispatchQueue.main.async {
|
||||
sublerDoc.close()
|
||||
}
|
||||
|
||||
logger.write(toLog: "Script successfully closed document")
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@objc(SBMetadataResult)
|
||||
class SBMetadataResult: NSObject {
|
||||
@objc dynamic var title: String?
|
||||
@objc dynamic var year: NSNumber?
|
||||
@objc dynamic var series: String?
|
||||
@objc dynamic var season: NSNumber?
|
||||
@objc dynamic var episode: NSNumber?
|
||||
@objc dynamic var mediaType: String?
|
||||
|
||||
init(title: String?, year: Int? = nil, series: String? = nil, season: Int? = nil, episode: Int? = nil, mediaType: String?) {
|
||||
self.title = title
|
||||
self.year = year.map { NSNumber(value: $0) }
|
||||
self.series = series
|
||||
self.season = season.map { NSNumber(value: $0) }
|
||||
self.episode = episode.map { NSNumber(value: $0) }
|
||||
self.mediaType = mediaType
|
||||
super.init()
|
||||
}
|
||||
}
|
||||
|
||||
@objc(SBFetchMetadataResultsScriptCommand)
|
||||
class SBFetchMetadataResultsScriptCommand: NSScriptCommand, ScriptCommandDocumentTargeting {
|
||||
|
||||
override func performDefaultImplementation() -> Any? {
|
||||
let logger = Logger.shared
|
||||
guard let sublerDoc = targetedDocument() else {
|
||||
logger.write(toLog: "No document available for fetching metadata results")
|
||||
return []
|
||||
}
|
||||
|
||||
// Access the MP42File through the custom Document subclass
|
||||
let mp4File = sublerDoc.mp4
|
||||
let searchTerms = mp4File.extractSearchTerms(fallbackURL: sublerDoc.fileURL)
|
||||
|
||||
logger.write(toLog: "Starting metadata search for terms: \(searchTerms)")
|
||||
|
||||
// Use a semaphore to make this synchronous, but run search on background queue
|
||||
let semaphore = DispatchSemaphore(value: 0)
|
||||
var searchResults: [SBMetadataResult] = []
|
||||
|
||||
// Get the optional limit parameter
|
||||
let limit = self.evaluatedArguments?["limit"] as? Int
|
||||
|
||||
// Get the optional provider and language parameters
|
||||
let provider = self.evaluatedArguments?["provider"] as? String
|
||||
let language = self.evaluatedArguments?["language"] as? String
|
||||
|
||||
// Run the search on a background queue to avoid blocking main thread
|
||||
DispatchQueue.global(qos: .userInitiated).async {
|
||||
self.searchMetadataResults(terms: searchTerms, provider: provider, language: language) { results in
|
||||
searchResults = results ?? []
|
||||
logger.write(toLog: "Metadata search completed with \(searchResults.count) results")
|
||||
semaphore.signal()
|
||||
}
|
||||
}
|
||||
|
||||
// Wait for the search to complete
|
||||
semaphore.wait()
|
||||
|
||||
// Apply limit if specified
|
||||
if let limit = limit, limit > 0 {
|
||||
let limitedResults = Array(searchResults.prefix(limit))
|
||||
searchResults = limitedResults
|
||||
}
|
||||
|
||||
// Convert results to formatted strings
|
||||
let formattedResults = searchResults.map { result in
|
||||
if result.mediaType == "movie" {
|
||||
if let year = result.year {
|
||||
return "Movie: \(result.title ?? "Unknown") (\(year))"
|
||||
} else {
|
||||
return "Movie: \(result.title ?? "Unknown")"
|
||||
}
|
||||
} else if result.mediaType == "tvshow" {
|
||||
var tvString = "TV: "
|
||||
if let series = result.series {
|
||||
tvString += series
|
||||
}
|
||||
if let season = result.season {
|
||||
tvString += " S\(season)"
|
||||
}
|
||||
if let episode = result.episode {
|
||||
tvString += "E\(episode)"
|
||||
}
|
||||
if let title = result.title {
|
||||
tvString += " \(title)"
|
||||
}
|
||||
return tvString.isEmpty ? "Unknown TV Show" : tvString
|
||||
} else {
|
||||
return result.title ?? "Unknown"
|
||||
}
|
||||
}
|
||||
|
||||
logger.write(toLog: "Returning \(formattedResults.count) results")
|
||||
return formattedResults
|
||||
}
|
||||
|
||||
private func searchMetadataResults(terms: MetadataSearchTerms, provider: String? = nil, language: String? = nil, completion: @escaping ([SBMetadataResult]?) -> Void) {
|
||||
// Determine which services to use based on provider parameter
|
||||
let movieService: MetadataService
|
||||
let tvShowService: MetadataService
|
||||
|
||||
if let providerName = provider {
|
||||
// Use the specified provider for both movie and TV searches
|
||||
let service = MetadataSearch.service(name: providerName)
|
||||
movieService = service
|
||||
tvShowService = service
|
||||
} else {
|
||||
// Use default services
|
||||
movieService = MetadataSearch.defaultMovieService
|
||||
tvShowService = MetadataSearch.defaultTVService
|
||||
}
|
||||
|
||||
// Convert language to appropriate format for the service
|
||||
let convertedLanguage: String?
|
||||
if let languageCode = language {
|
||||
if movieService.languageType == .ISO {
|
||||
// For ISO services (TheMovieDB, TheTVDB), use the language code as-is
|
||||
convertedLanguage = languageCode
|
||||
} else {
|
||||
// For custom services (Apple TV, iTunes Store), try to find a matching store
|
||||
let availableLanguages = movieService.languages
|
||||
if let matchingLanguage = availableLanguages.first(where: { $0.lowercased().contains(languageCode.lowercased()) }) {
|
||||
convertedLanguage = matchingLanguage
|
||||
} else {
|
||||
// Fall back to default language if no match found
|
||||
convertedLanguage = movieService.defaultLanguage
|
||||
}
|
||||
}
|
||||
} else {
|
||||
convertedLanguage = nil
|
||||
}
|
||||
|
||||
// Determine which language to use for the search
|
||||
let searchLanguage = convertedLanguage ?? movieService.defaultLanguage
|
||||
|
||||
// Perform the search based on media type
|
||||
switch terms {
|
||||
case .movie(let title):
|
||||
let results = movieService.search(movie: title, language: searchLanguage)
|
||||
|
||||
// Convert MetadataResult to SBMetadataResult
|
||||
let sbResults = results.map { result in
|
||||
// Extract year from releaseDate if it's a string
|
||||
let year: Int? = {
|
||||
if let releaseDate = result[.releaseDate] as? String {
|
||||
// Try to extract year from date string (e.g., "2023-12-25" -> 2023)
|
||||
let components = releaseDate.split(separator: "-")
|
||||
if let yearString = components.first {
|
||||
return Int(yearString)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}()
|
||||
|
||||
return SBMetadataResult(
|
||||
title: result[.name] as? String,
|
||||
year: year,
|
||||
series: nil,
|
||||
season: nil,
|
||||
episode: nil,
|
||||
mediaType: "movie"
|
||||
)
|
||||
}
|
||||
completion(sbResults)
|
||||
|
||||
case .tvShow(let title, let season, let episode):
|
||||
let results = tvShowService.search(tvShow: title, language: searchLanguage, season: season, episode: episode)
|
||||
|
||||
// Convert MetadataResult to SBMetadataResult
|
||||
let sbResults = results.map { result in
|
||||
// Extract year from releaseDate if it's a string
|
||||
let year: Int? = {
|
||||
if let releaseDate = result[.releaseDate] as? String {
|
||||
// Try to extract year from date string (e.g., "2023-12-25" -> 2023)
|
||||
let components = releaseDate.split(separator: "-")
|
||||
if let yearString = components.first {
|
||||
return Int(yearString)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}()
|
||||
|
||||
return SBMetadataResult(
|
||||
title: result[.name] as? String,
|
||||
year: year,
|
||||
series: result[.seriesName] as? String,
|
||||
season: result[.season] as? Int,
|
||||
episode: result[.episodeNumber] as? Int,
|
||||
mediaType: "tvshow"
|
||||
)
|
||||
}
|
||||
completion(sbResults)
|
||||
|
||||
case .none:
|
||||
completion([])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc(SBFetchAndSetMetadataResultScriptCommand)
|
||||
class SBFetchAndSetMetadataResultScriptCommand: NSScriptCommand, ScriptCommandDocumentTargeting {
|
||||
|
||||
override func performDefaultImplementation() -> Any? {
|
||||
let logger = Logger.shared
|
||||
|
||||
// Get the result index from direct parameter
|
||||
guard let resultIndex = self.directParameter as? Int else {
|
||||
logger.write(toLog: "Missing result index parameter")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Get the optional provider and language parameters
|
||||
let provider = self.evaluatedArguments?["provider"] as? String
|
||||
let language = self.evaluatedArguments?["language"] as? String
|
||||
|
||||
guard let sublerDoc = targetedDocument() else {
|
||||
logger.write(toLog: "No document available for metadata operation")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Access the MP42File through the custom Document subclass
|
||||
let mp4File = sublerDoc.mp4
|
||||
let searchTerms = mp4File.extractSearchTerms(fallbackURL: sublerDoc.fileURL)
|
||||
|
||||
// Perform search and apply the nth result
|
||||
searchMetadataAndSetResult(terms: searchTerms, resultIndex: resultIndex - 1, provider: provider, language: language) { success in
|
||||
DispatchQueue.main.async {
|
||||
if success {
|
||||
// Trigger UI refresh
|
||||
if let windowController = sublerDoc.windowControllers.first as? DocumentWindowController {
|
||||
windowController.reloadData()
|
||||
}
|
||||
logger.write(toLog: "Successfully set metadata result \(resultIndex)")
|
||||
} else {
|
||||
logger.write(toLog: "Failed to set metadata result \(resultIndex) - index out of bounds or no results")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
private func searchMetadataAndSetResult(terms: MetadataSearchTerms, resultIndex: Int, provider: String?, language: String?, completion: @escaping (Bool) -> Void) {
|
||||
// Determine which services to use based on provider parameter
|
||||
let movieService: MetadataService
|
||||
let tvShowService: MetadataService
|
||||
|
||||
if let providerName = provider {
|
||||
// Use the specified provider for both movie and TV searches
|
||||
let service = MetadataSearch.service(name: providerName)
|
||||
movieService = service
|
||||
tvShowService = service
|
||||
} else {
|
||||
// Use default services
|
||||
movieService = MetadataSearch.defaultMovieService
|
||||
tvShowService = MetadataSearch.defaultTVService
|
||||
}
|
||||
|
||||
// Convert language to appropriate format for the service
|
||||
let convertedLanguage: String?
|
||||
if let languageCode = language {
|
||||
if movieService.languageType == .ISO {
|
||||
// For ISO services (TheMovieDB, TheTVDB), use the language code as-is
|
||||
convertedLanguage = languageCode
|
||||
} else {
|
||||
// For custom services (Apple TV, iTunes Store), try to find a matching store
|
||||
let availableLanguages = movieService.languages
|
||||
if let matchingLanguage = availableLanguages.first(where: { $0.lowercased().contains(languageCode.lowercased()) }) {
|
||||
convertedLanguage = matchingLanguage
|
||||
} else {
|
||||
// Fall back to default language if no match found
|
||||
convertedLanguage = movieService.defaultLanguage
|
||||
}
|
||||
}
|
||||
} else {
|
||||
convertedLanguage = nil
|
||||
}
|
||||
|
||||
// Determine which language to use for the search
|
||||
let searchLanguage = convertedLanguage ?? movieService.defaultLanguage
|
||||
|
||||
// Get user preferences for artwork from Queue preferences
|
||||
let queuePrefs = QueuePreferences()
|
||||
let preferredArtwork = ArtworkType(rawValue: queuePrefs.providerArtwork) ?? .poster
|
||||
let preferredArtworkSize = ArtworkSize(rawValue: queuePrefs.providerArtworkSize) ?? .standard
|
||||
|
||||
// Perform the search based on media type
|
||||
switch terms {
|
||||
case let .movie(title):
|
||||
let movieSearch = MetadataSearch.movieSeach(service: movieService, movie: title, language: searchLanguage)
|
||||
_ = movieSearch.search(completionHandler: { results in
|
||||
if resultIndex >= 0 && resultIndex < results.count {
|
||||
let selectedResult = results[resultIndex]
|
||||
|
||||
// Load additional metadata for the selected result
|
||||
_ = movieSearch.loadAdditionalMetadata(selectedResult, completionHandler: { metadataResult in
|
||||
// Handle artwork similar to QueueMetadataAction
|
||||
let artworks = metadataResult.remoteArtworks
|
||||
|
||||
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) {
|
||||
return artwork
|
||||
} else if let artwork = artworks.filter(by: .poster, size: .standard, service: movieService.name) {
|
||||
return artwork
|
||||
} else {
|
||||
return artworks.first
|
||||
}
|
||||
}()
|
||||
|
||||
// Load and add artwork to metadata result BEFORE mapping
|
||||
if let url = artwork?.url, let artworkData = URLSession.data(from: url) {
|
||||
let mp42Image = MP42Image(data: artworkData, type: MP42_ART_JPEG)
|
||||
metadataResult.artworks.append(mp42Image)
|
||||
}
|
||||
}
|
||||
|
||||
// Map the metadata using the same logic as QueueAction
|
||||
let map = metadataResult.mediaKind == .movie ? MetadataPrefs.movieResultMap : MetadataPrefs.tvShowResultMap
|
||||
let mappedMetadata = metadataResult.mappedMetadata(to: map, keepEmptyKeys: false)
|
||||
|
||||
// Apply the metadata
|
||||
DispatchQueue.main.async {
|
||||
if let sublerDoc = self.targetedDocument() {
|
||||
sublerDoc.mp4.metadata.merge(mappedMetadata)
|
||||
sublerDoc.updateChangeCount(.changeDone)
|
||||
completion(true)
|
||||
} else {
|
||||
completion(false)
|
||||
}
|
||||
}
|
||||
}).run()
|
||||
} else {
|
||||
completion(false)
|
||||
}
|
||||
}).run()
|
||||
|
||||
case let .tvShow(title, season, episode):
|
||||
let tvSearch = MetadataSearch.tvSearch(service: tvShowService, tvShow: title, season: season, episode: episode, language: searchLanguage)
|
||||
_ = tvSearch.search(completionHandler: { results in
|
||||
if resultIndex >= 0 && resultIndex < results.count {
|
||||
let selectedResult = results[resultIndex]
|
||||
|
||||
// Load additional metadata for the selected result
|
||||
_ = tvSearch.loadAdditionalMetadata(selectedResult, completionHandler: { metadataResult in
|
||||
// Handle artwork similar to QueueMetadataAction
|
||||
let artworks = metadataResult.remoteArtworks
|
||||
|
||||
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) {
|
||||
return artwork
|
||||
} else if let artwork = artworks.filter(by: .poster, size: .standard, service: tvShowService.name) {
|
||||
return artwork
|
||||
} else {
|
||||
return artworks.first
|
||||
}
|
||||
}()
|
||||
|
||||
// Load and add artwork to metadata result BEFORE mapping
|
||||
if let url = artwork?.url, let artworkData = URLSession.data(from: url) {
|
||||
let mp42Image = MP42Image(data: artworkData, type: MP42_ART_JPEG)
|
||||
metadataResult.artworks.append(mp42Image)
|
||||
}
|
||||
}
|
||||
|
||||
// Map the metadata using the same logic as QueueAction
|
||||
let map = metadataResult.mediaKind == .movie ? MetadataPrefs.movieResultMap : MetadataPrefs.tvShowResultMap
|
||||
let mappedMetadata = metadataResult.mappedMetadata(to: map, keepEmptyKeys: false)
|
||||
|
||||
// Apply the metadata
|
||||
DispatchQueue.main.async {
|
||||
if let sublerDoc = self.targetedDocument() {
|
||||
sublerDoc.mp4.metadata.merge(mappedMetadata)
|
||||
sublerDoc.updateChangeCount(.changeDone)
|
||||
completion(true)
|
||||
} else {
|
||||
completion(false)
|
||||
}
|
||||
}
|
||||
}).run()
|
||||
} else {
|
||||
completion(false)
|
||||
}
|
||||
}).run()
|
||||
case .none:
|
||||
completion(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
-8
@@ -22,9 +22,13 @@
|
||||
<string>com.apple.protected-mpeg-4-video</string>
|
||||
</array>
|
||||
<key>NSDocumentClass</key>
|
||||
<string>Subler.Document</string>
|
||||
<string>SBDocument</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>mp4</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Movie-MPEG4</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
@@ -36,9 +40,13 @@
|
||||
<string>public.mpeg-4</string>
|
||||
</array>
|
||||
<key>NSDocumentClass</key>
|
||||
<string>Subler.Document</string>
|
||||
<string>SBDocument</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>m4a</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Audio-MPEG4</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
@@ -50,9 +58,13 @@
|
||||
<string>public.mpeg-4-audio</string>
|
||||
</array>
|
||||
<key>NSDocumentClass</key>
|
||||
<string>Subler.Document</string>
|
||||
<string>SBDocument</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>m4b</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Audiobook</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
@@ -64,7 +76,7 @@
|
||||
<string>com.apple.protected-mpeg-4-audio</string>
|
||||
</array>
|
||||
<key>NSDocumentClass</key>
|
||||
<string>Subler.Document</string>
|
||||
<string>SBDocument</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
@@ -80,7 +92,7 @@
|
||||
<string>com.apple.mpeg-4-ringtone</string>
|
||||
</array>
|
||||
<key>NSDocumentClass</key>
|
||||
<string>Subler.Document</string>
|
||||
<string>SBDocument</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
@@ -96,7 +108,7 @@
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Alternate</string>
|
||||
<key>NSDocumentClass</key>
|
||||
<string>Subler.Document</string>
|
||||
<string>SBDocument</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
@@ -110,7 +122,7 @@
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Alternate</string>
|
||||
<key>NSDocumentClass</key>
|
||||
<string>Subler.Document</string>
|
||||
<string>SBDocument</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
@@ -158,7 +170,7 @@
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>OSAScriptingDefinition</key>
|
||||
<string>Queue.sdef</string>
|
||||
<string>Subler.sdef</string>
|
||||
<key>SUAllowsAutomaticUpdates</key>
|
||||
<false/>
|
||||
<key>SUFeedURL</key>
|
||||
|
||||
+1
-1
Submodule MP42Foundation updated: 47aadecfff...72c09dab2d.
+18
-2
@@ -1,9 +1,25 @@
|
||||
# Subler News
|
||||
|
||||
## Subler 1.8.9
|
||||
|
||||
- Expanded the AppleScript dictionary [Mock1]
|
||||
- Added additional keyboard shortcuts [Mock1]
|
||||
- Added support for unofficial metadata often used for Audiobooks
|
||||
- Make it possible to use the services ids in the metadata map
|
||||
- Fixed the "Insert a chaper at the beginning" menu item action
|
||||
- Fixed Swedish Ratings
|
||||
- Fixed the "None" artwork option in the Queue
|
||||
|
||||
|
||||
## Subler 1.8.8
|
||||
|
||||
- Fixed a crash that happened when editing a preset
|
||||
|
||||
|
||||
## Subler 1.8.7
|
||||
|
||||
- Preserves additional metadata from Matroska
|
||||
- Fixed a regression tha made the "Send to queue" and "Queue" toolbar button unclickable
|
||||
- Fixed a regression that made the "Send to queue" and "Queue" toolbar button unclickable
|
||||
|
||||
|
||||
## Subler 1.8.6
|
||||
@@ -161,7 +177,7 @@
|
||||
## Subler 1.5.22
|
||||
|
||||
* "4k" is not set automatically anymore because the AppleTV won't stream mp4 with such metadata.
|
||||
* Fixes an an additional issue that could led to a crash when importing a 5.1 channels ac3 file on macOS 10.15.
|
||||
* Fixes an issue that could led to a crash when importing a 5.1 channels ac3 file on macOS 10.15.
|
||||
* Fixes Indian iTunes Store.
|
||||
|
||||
|
||||
|
||||
-98
@@ -1,98 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
|
||||
<dictionary title="Subler Terminology" xmlns:xi="http://www.w3.org/2003/XInclude">
|
||||
|
||||
<xi:include href="file:///System/Library/ScriptingDefinitions/CocoaStandard.sdef" xpointer="xpointer(/dictionary/suite)" />
|
||||
|
||||
<suite name="Subler Suite" code="sktc" description="Classes just for the Subler application.">
|
||||
<cocoa name="Subler" />
|
||||
<enumeration name="saveable file format" code="savf">
|
||||
<enumerator name="Video-MPEG4" code="M4V " description="Video-MPEG4">
|
||||
<cocoa string-value="com.apple.protected-mpeg-4-video"/>
|
||||
</enumerator>
|
||||
<enumerator name="Movie-MPEG4" code="MP4 " description="MPEG-4">
|
||||
<cocoa string-value="public.mpeg-4"/>
|
||||
</enumerator>
|
||||
<enumerator name="Audio-MPEG4" code="M4A " description="Audio-MPEG4">
|
||||
<cocoa string-value="public.mpeg-4-audio"/>
|
||||
</enumerator>
|
||||
</enumeration>
|
||||
|
||||
<class-extension extends="document" description="A Subler document.">
|
||||
<cocoa class="SBDocument" />
|
||||
</class-extension>
|
||||
|
||||
</suite>
|
||||
|
||||
<suite name="Queue Suite" code="ScTa" description="Queue suite.">
|
||||
<class-extension extends="application" description="Queue's top level scripting object.">
|
||||
<element type="queue item" access="r" description="The queue items">
|
||||
<cocoa key="queueItems"/>
|
||||
</element>
|
||||
</class-extension>
|
||||
|
||||
<command name="add to queue" code="QueueAdd" description="Add a file to queue.">
|
||||
<cocoa class="SBQueueScriptCommand"/>
|
||||
<direct-parameter description="The file(s) to be added.">
|
||||
<type type="file" list="yes"/>
|
||||
</direct-parameter>
|
||||
</command>
|
||||
|
||||
<command name="start queue and wait" code="QueueStw" description="Start the queue and wait until its completion.">
|
||||
<cocoa class="SBQueueStartAndWaitScriptCommand"/>
|
||||
</command>
|
||||
|
||||
<command name="start queue" code="QueueSta" description="Start the queue.">
|
||||
<cocoa class="SBQueueStartScriptCommand"/>
|
||||
</command>
|
||||
|
||||
<command name="stop queue" code="QueueSto" description="Stop the queue.">
|
||||
<cocoa class="SBQueueStopScriptCommand"/>
|
||||
</command>
|
||||
|
||||
<enumeration name="queue item status" code="Qsta" description="A status">
|
||||
<enumerator name="ready" code="STA1" description="Ready status.">
|
||||
<cocoa integer-value="0"/>
|
||||
</enumerator>
|
||||
<enumerator name="editing" code="STA2" description="Editing status.">
|
||||
<cocoa integer-value="1"/>
|
||||
</enumerator>
|
||||
<enumerator name="working" code="STA3" description="Working status.">
|
||||
<cocoa integer-value="2"/>
|
||||
</enumerator>
|
||||
<enumerator name="completed" code="STA4" description="Completed status.">
|
||||
<cocoa integer-value="3"/>
|
||||
</enumerator>
|
||||
<enumerator name="failed" code="STA5" description="Failed status.">
|
||||
<cocoa integer-value="4"/>
|
||||
</enumerator>
|
||||
<enumerator name="cancelled" code="STA6" description="Cancelled status.">
|
||||
<cocoa integer-value="5"/>
|
||||
</enumerator>
|
||||
</enumeration>
|
||||
|
||||
<class name="queue item" code="QIte" description="A queue item" inherits="item" plural="queue items">
|
||||
<cocoa class="SBQueueItem"/>
|
||||
|
||||
<property name="id" code="ID " type="text" access="r" description="The unique identifier of the queue item.">
|
||||
<cocoa key="uniqueID"/>
|
||||
</property>
|
||||
|
||||
<property name="status" code="StAt" type="queue item status" access="r" description="The status of the queue item.">
|
||||
</property>
|
||||
|
||||
<property name="name" code="pnam" type="text" access="r" description="The name of the queue item.">
|
||||
</property>
|
||||
|
||||
<property name="sourcePath" code="SOUR" type="text" access="r" description="The source URL of the queue item.">
|
||||
<cocoa key="sourcePath"/>
|
||||
</property>
|
||||
|
||||
<property name="destinationPath" code="DEST" type="text" access="r" description="The destination URL of the queue item.">
|
||||
<cocoa key="destinationPath"/>
|
||||
</property>
|
||||
|
||||
</class>
|
||||
|
||||
</suite>
|
||||
</dictionary>
|
||||
+6
-6
@@ -206,12 +206,12 @@
|
||||
"country" : "Sverige",
|
||||
"storeCode" : 143456,
|
||||
"ratings" : [
|
||||
{ "media" : "Movie & TV", "prefix" : "se-movie", "itunes-code" : "A", "itunes-value" : "000", "description" : "Barntillåten" },
|
||||
{ "media" : "Movie & TV", "prefix" : "se-movie", "itunes-code" : "7", "itunes-value" : "125", "description" : "Från 7 år" },
|
||||
{ "media" : "Movie & TV", "prefix" : "se-movie", "itunes-code" : "11", "itunes-value" : "225", "description" : "Från 11 år" },
|
||||
{ "media" : "Movie & TV", "prefix" : "se-movie", "itunes-code" : "15", "itunes-value" : "400", "description" : "Från 15 år" },
|
||||
{ "media" : "Movie & TV", "prefix" : "se-movie", "itunes-code" : "Unrated", "itunes-value" : "???", "description" : "Ocensurerad" },
|
||||
{ "media" : "Movie & TV", "prefix" : "se-movie", "itunes-code" : "Unrated", "itunes-value" : "???", "description" : "Inte klassificerad" }
|
||||
{ "media" : "Movie & TV", "prefix" : "se-movie", "itunes-code" : "Barntillåten", "itunes-value" : "000", "description" : "Barntillåten" },
|
||||
{ "media" : "Movie & TV", "prefix" : "se-movie", "itunes-code" : "Från 7 År", "itunes-value" : "125", "description" : "Från 7 år" },
|
||||
{ "media" : "Movie & TV", "prefix" : "se-movie", "itunes-code" : "Från 11 År", "itunes-value" : "225", "description" : "Från 11 år" },
|
||||
{ "media" : "Movie & TV", "prefix" : "se-movie", "itunes-code" : "Från 15 År", "itunes-value" : "400", "description" : "Från 15 år" },
|
||||
{ "media" : "Movie & TV", "prefix" : "se-movie", "itunes-code" : "Unrated", "itunes-value" : "???", "description" : "Ocensurerad" },
|
||||
{ "media" : "Movie & TV", "prefix" : "se-movie", "itunes-code" : "Unrated", "itunes-value" : "???", "description" : "Inte klassificerad" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dictionary SYSTEM "file:///localhost/System/Library/DTDs/sdef.dtd">
|
||||
<dictionary title="Subler Terminology" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<xi:include href="file:///System/Library/ScriptingDefinitions/CocoaStandard.sdef" xpointer="xpointer(/dictionary/suite)" />
|
||||
|
||||
<class-extension extends="application" description="Queue's top level scripting object.">
|
||||
<element type="queue item" access="r" description="The queue items">
|
||||
<cocoa key="queueItems"/>
|
||||
</element>
|
||||
</class-extension>
|
||||
|
||||
<suite name="Subler Automation Suite" code="Subl" description="Automation functions for Subler.">
|
||||
|
||||
<!-- Commands -->
|
||||
|
||||
<!-- File Commands -->
|
||||
<command name="import file" code="SublFilI" description="Import a file into the active document.">
|
||||
<cocoa class="SBImportFileScriptCommand" />
|
||||
<direct-parameter description="The file to import.">
|
||||
<type type="file" />
|
||||
</direct-parameter>
|
||||
<parameter name="into" code="into" type="document" optional="yes" description="The target document to import into." />
|
||||
</command>
|
||||
|
||||
<command name="save as" code="SublSave" description="Save the active document to a file.">
|
||||
<cocoa class="SBSaveAsScriptCommand" />
|
||||
<direct-parameter description="The destination file path.">
|
||||
<type type="file" />
|
||||
</direct-parameter>
|
||||
<parameter name="doc" code="docu" type="document" optional="yes" description="The target document to save." />
|
||||
</command>
|
||||
|
||||
<command name="send to queue" code="SublSenQ" description="Send the active document to the queue.">
|
||||
<cocoa class="SBSendToQueueScriptCommand" />
|
||||
<direct-parameter description="The destination file path.">
|
||||
<type type="file" />
|
||||
</direct-parameter>
|
||||
<parameter name="doc" code="docu" type="document" optional="yes" description="The target document to send to queue." />
|
||||
</command>
|
||||
|
||||
<command name="close document" code="SublClos" description="Close the active document window without prompting for unsaved changes.">
|
||||
<cocoa class="SBCloseFileScriptCommand" />
|
||||
<parameter name="doc" code="docu" type="document" optional="yes" description="The target document to close." />
|
||||
</command>
|
||||
|
||||
<!-- Metadata Commands -->
|
||||
<command name="fetch metadata" code="SublMeta" description="Fetch metadata for the active document.">
|
||||
<cocoa class="SBFetchMetadataScriptCommand" />
|
||||
<parameter name="into" code="into" type="document" optional="yes" description="The target document to fetch metadata for." />
|
||||
</command>
|
||||
|
||||
<command name="fetch metadata candidates" code="SublFRes" description="Fetch metadata results without applying them.">
|
||||
<cocoa class="SBFetchMetadataResultsScriptCommand" />
|
||||
<parameter name="into" code="into" type="document" optional="yes" description="The target document to fetch metadata candidates for." />
|
||||
<parameter name="limit" code="limt" type="integer" optional="yes" description="Maximum number of results to return." />
|
||||
<parameter name="provider" code="prov" type="text" optional="yes" description="Metadata provider to use (Apple TV, TheMovieDB, TheTVDB, iTunes Store)." />
|
||||
<parameter name="language" code="lang" type="text" optional="yes" description="Language for metadata search (e.g., 'en', 'es', 'fr')." />
|
||||
<result description="The metadata results.">
|
||||
<type type="text" list="yes"/>
|
||||
</result>
|
||||
</command>
|
||||
|
||||
<command name="fetch and set metadata candidate" code="SublSetM" description="Fetch metadata and set the specified result.">
|
||||
<cocoa class="SBFetchAndSetMetadataResultScriptCommand" />
|
||||
<direct-parameter description="The result index to set (1-based).">
|
||||
<type type="integer" />
|
||||
</direct-parameter>
|
||||
<parameter name="into" code="into" type="document" optional="yes" description="The target document to set metadata for." />
|
||||
<parameter name="provider" code="prov" type="text" optional="yes" description="Metadata provider to use (Apple TV, TheMovieDB, TheTVDB, iTunes Store)." />
|
||||
<parameter name="language" code="lang" type="text" optional="yes" description="Language for metadata search (e.g., 'en', 'es', 'fr')." />
|
||||
</command>
|
||||
|
||||
<!-- Edit Commands -->
|
||||
<command name="organize alternate groups" code="SublOrgG" description="Organize alternate audio groups.">
|
||||
<cocoa class="SBOrganizeAlternateGroupsScriptCommand" />
|
||||
<parameter name="into" code="into" type="document" optional="yes" description="The target document to organize alternate groups for." />
|
||||
</command>
|
||||
|
||||
<command name="clear track names" code="SublClea" description="Clear all track names.">
|
||||
<cocoa class="SBClearTrackNamesScriptCommand" />
|
||||
<parameter name="into" code="into" type="document" optional="yes" description="The target document to clear track names for." />
|
||||
</command>
|
||||
|
||||
<command name="prettify audio track names" code="SublPret" description="Prettify audio track names.">
|
||||
<cocoa class="SBPrettifyAudioTrackNamesScriptCommand" />
|
||||
<parameter name="into" code="into" type="document" optional="yes" description="The target document to prettify audio track names for." />
|
||||
</command>
|
||||
|
||||
<command name="fix audio fallbacks" code="SublFixF" description="Fix audio fallback settings.">
|
||||
<cocoa class="SBFixAudioFallbacksScriptCommand" />
|
||||
<parameter name="into" code="into" type="document" optional="yes" description="The target document to fix audio fallbacks for." />
|
||||
</command>
|
||||
|
||||
<!-- Queue Commands -->
|
||||
<command name="add to queue" code="SublQAdd" description="Add a file to queue.">
|
||||
<cocoa class="SBQueueScriptCommand"/>
|
||||
<direct-parameter description="The file(s) to be added.">
|
||||
<type type="file" list="yes"/>
|
||||
</direct-parameter>
|
||||
</command>
|
||||
|
||||
<command name="start queue and wait" code="SublQStw" description="Start the queue and wait until its completion.">
|
||||
<cocoa class="SBQueueStartAndWaitScriptCommand"/>
|
||||
</command>
|
||||
|
||||
<command name="start queue" code="SublQSta" description="Start the queue.">
|
||||
<cocoa class="SBQueueStartScriptCommand"/>
|
||||
</command>
|
||||
|
||||
<command name="stop queue" code="SublQSto" description="Stop the queue.">
|
||||
<cocoa class="SBQueueStopScriptCommand"/>
|
||||
</command>
|
||||
|
||||
<command name="remove completed items from queue" code="SublQRem" description="Remove all completed items from the queue.">
|
||||
<cocoa class="SBQueueRemoveCompletedScriptCommand"/>
|
||||
</command>
|
||||
|
||||
<command name="get queue status" code="SublQSts" description="Get the current status of the queue.">
|
||||
<cocoa class="SBQueueStatusScriptCommand"/>
|
||||
<result description="The status of the queue.">
|
||||
<type type="queue status"/>
|
||||
</result>
|
||||
</command>
|
||||
|
||||
<!-- Queue Enumerations -->
|
||||
<enumeration name="queue status" code="QSts" description="The status of the queue.">
|
||||
<enumerator name="idle" code="QIDL" description="Queue is idle.">
|
||||
<cocoa integer-value="0"/>
|
||||
</enumerator>
|
||||
<enumerator name="running" code="QRUN" description="Queue is running.">
|
||||
<cocoa integer-value="1"/>
|
||||
</enumerator>
|
||||
<enumerator name="completed" code="QCOM" description="Queue has completed.">
|
||||
<cocoa integer-value="2"/>
|
||||
</enumerator>
|
||||
</enumeration>
|
||||
|
||||
<enumeration name="queue item status" code="QISt" description="A status">
|
||||
<enumerator name="ready" code="STA1" description="Ready status.">
|
||||
<cocoa integer-value="0"/>
|
||||
</enumerator>
|
||||
<enumerator name="editing" code="STA2" description="Editing status.">
|
||||
<cocoa integer-value="1"/>
|
||||
</enumerator>
|
||||
<enumerator name="working" code="STA3" description="Working status.">
|
||||
<cocoa integer-value="2"/>
|
||||
</enumerator>
|
||||
<enumerator name="completed" code="STA4" description="Completed status.">
|
||||
<cocoa integer-value="3"/>
|
||||
</enumerator>
|
||||
<enumerator name="failed" code="STA5" description="Failed status.">
|
||||
<cocoa integer-value="4"/>
|
||||
</enumerator>
|
||||
<enumerator name="cancelled" code="STA6" description="Cancelled status.">
|
||||
<cocoa integer-value="5"/>
|
||||
</enumerator>
|
||||
</enumeration>
|
||||
|
||||
<!-- Queue Classes -->
|
||||
<class name="document" code="docu" description="A Subler document" plural="documents">
|
||||
<cocoa class="SBDocument"/>
|
||||
<property name="id" code="ID " type="integer" access="r" description="The unique identifier of the document.">
|
||||
<cocoa key="uniqueID"/>
|
||||
</property>
|
||||
<property name="name" code="pnam" type="text" access="r" description="The name of the document.">
|
||||
<cocoa key="displayName"/>
|
||||
</property>
|
||||
<property name="modified" code="imod" type="boolean" access="r" description="Whether the document has been modified.">
|
||||
<cocoa key="isDocumentEdited"/>
|
||||
</property>
|
||||
<property name="file" code="file" type="file" access="r" description="The file associated with the document.">
|
||||
<cocoa key="fileURL"/>
|
||||
</property>
|
||||
</class>
|
||||
|
||||
<class name="queue item" code="QIte" description="A queue item" inherits="item" plural="queue items">
|
||||
<cocoa class="SBQueueItem"/>
|
||||
|
||||
<property name="id" code="ID " type="text" access="r" description="The unique identifier of the queue item.">
|
||||
<cocoa key="uniqueID"/>
|
||||
</property>
|
||||
|
||||
<property name="status" code="StAt" type="queue item status" access="r" description="The status of the queue item.">
|
||||
</property>
|
||||
|
||||
<property name="name" code="pnam" type="text" access="r" description="The name of the queue item.">
|
||||
</property>
|
||||
|
||||
<property name="sourcePath" code="SOUR" type="text" access="r" description="The source URL of the queue item.">
|
||||
<cocoa key="sourcePath"/>
|
||||
</property>
|
||||
|
||||
<property name="destinationPath" code="DEST" type="text" access="r" description="The destination URL of the queue item.">
|
||||
<cocoa key="destinationPath"/>
|
||||
</property>
|
||||
|
||||
</class>
|
||||
|
||||
</suite>
|
||||
</dictionary>
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */; };
|
||||
4AFFB6D22DF751110099E229 /* Subler.sdef in Resources */ = {isa = PBXBuildFile; fileRef = 4AFFB6D12DF751110099E229 /* Subler.sdef */; };
|
||||
61CEC0CE1E7569E4000FECC1 /* MultiSelectView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61CEC0CC1E7569E4000FECC1 /* MultiSelectView.xib */; };
|
||||
8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */; };
|
||||
8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; };
|
||||
@@ -22,7 +23,6 @@
|
||||
A90300C81DAE72C4008237D8 /* PresetPrefsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A90300CA1DAE72C4008237D8 /* PresetPrefsViewController.xib */; };
|
||||
A90331BD23ED7EE5006BB91D /* Prefs.swift in Sources */ = {isa = PBXBuildFile; fileRef = A90331BC23ED7EE5006BB91D /* Prefs.swift */; };
|
||||
A9067A0C1F3CA4E6008011DC /* MetadataPrefsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9067A0B1F3CA4E6008011DC /* MetadataPrefsViewController.swift */; };
|
||||
A906B5B11E434872007D12B1 /* Queue.sdef in Resources */ = {isa = PBXBuildFile; fileRef = A906B5B01E434872007D12B1 /* Queue.sdef */; };
|
||||
A90B023B10F3290A000416F3 /* PrefsWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A90B023910F3290A000416F3 /* PrefsWindowController.xib */; };
|
||||
A90B094C235614D200F1B191 /* AppleTV.swift in Sources */ = {isa = PBXBuildFile; fileRef = A90B094B235614D200F1B191 /* AppleTV.swift */; };
|
||||
A90BC5E31F3A139700F9F3F3 /* MetadataResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = A90BC5E21F3A139700F9F3F3 /* MetadataResult.swift */; };
|
||||
@@ -114,6 +114,7 @@
|
||||
A9C31E602029A80F00CEF474 /* AdvancedPrefsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C31E5E2029A80F00CEF474 /* AdvancedPrefsViewController.swift */; };
|
||||
A9C31E642029A82200CEF474 /* AdvancedPrefsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9C31E622029A82200CEF474 /* AdvancedPrefsViewController.xib */; };
|
||||
A9C3E44A205C07F4004DE24E /* OptionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C3E449205C07F4004DE24E /* OptionsViewController.swift */; };
|
||||
A9C51DF42E4B4548003E82E6 /* ScriptCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C51DF32E4B4548003E82E6 /* ScriptCommand.swift */; };
|
||||
A9C5FA7419FA2FEC0051F3FF /* SBActivityWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9C5FA7219FA2FEC0051F3FF /* SBActivityWindow.xib */; };
|
||||
A9C73536206B8F9900794673 /* QueuePreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C73535206B8F9900794673 /* QueuePreferences.swift */; };
|
||||
A9CB19022D10415D0074DC9F /* Storefronts.json in Resources */ = {isa = PBXBuildFile; fileRef = A9CB19012D10415D0074DC9F /* Storefronts.json */; };
|
||||
@@ -193,6 +194,7 @@
|
||||
/* Begin PBXFileReference section */
|
||||
1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
4AFFB6D12DF751110099E229 /* Subler.sdef */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Subler.sdef; sourceTree = "<group>"; };
|
||||
610362271E76D66A000DAE60 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = Classes/PropertyView/it.lproj/MultiSelectView.strings; sourceTree = "<group>"; };
|
||||
61CEC0CD1E7569E4000FECC1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Classes/PropertyView/Base.lproj/MultiSelectView.xib; sourceTree = "<group>"; };
|
||||
8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
@@ -209,7 +211,6 @@
|
||||
A90300C91DAE72C4008237D8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PresetPrefsViewController.xib; sourceTree = "<group>"; };
|
||||
A90331BC23ED7EE5006BB91D /* Prefs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Prefs.swift; path = Classes/Prefs.swift; sourceTree = "<group>"; };
|
||||
A9067A0B1F3CA4E6008011DC /* MetadataPrefsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MetadataPrefsViewController.swift; path = Classes/MetadataPrefsViewController.swift; sourceTree = "<group>"; };
|
||||
A906B5B01E434872007D12B1 /* Queue.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Queue.sdef; sourceTree = "<group>"; };
|
||||
A90B094B235614D200F1B191 /* AppleTV.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppleTV.swift; path = Classes/MetadataImporters/AppleTV.swift; sourceTree = "<group>"; };
|
||||
A90BC5E21F3A139700F9F3F3 /* MetadataResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MetadataResult.swift; path = Classes/MetadataImporters/MetadataResult.swift; sourceTree = "<group>"; };
|
||||
A90C3E0A1FD16AF200F64532 /* TokensViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TokensViewController.swift; path = Classes/TokensViewController.swift; sourceTree = "<group>"; };
|
||||
@@ -394,6 +395,7 @@
|
||||
A9C31E5E2029A80F00CEF474 /* AdvancedPrefsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AdvancedPrefsViewController.swift; path = Classes/AdvancedPrefsViewController.swift; sourceTree = "<group>"; };
|
||||
A9C31E632029A82200CEF474 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/AdvancedPrefsViewController.xib; sourceTree = "<group>"; };
|
||||
A9C3E449205C07F4004DE24E /* OptionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = OptionsViewController.swift; path = Classes/OptionsViewController.swift; sourceTree = "<group>"; };
|
||||
A9C51DF32E4B4548003E82E6 /* ScriptCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ScriptCommand.swift; path = Classes/ScriptCommand.swift; sourceTree = "<group>"; };
|
||||
A9C73535206B8F9900794673 /* QueuePreferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = QueuePreferences.swift; path = Classes/QueuePreferences.swift; sourceTree = "<group>"; };
|
||||
A9CB19012D10415D0074DC9F /* Storefronts.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = Storefronts.json; sourceTree = "<group>"; };
|
||||
A9CB19042D10417D0074DC9F /* Alpha2.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = Alpha2.json; sourceTree = "<group>"; };
|
||||
@@ -485,8 +487,8 @@
|
||||
2A37F4AAFDCFA73011CA2CEA /* MP4Sub */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4AFFB6D12DF751110099E229 /* Subler.sdef */,
|
||||
A9B4EE4E1643EBF3009AF6BC /* Subler.entitlements */,
|
||||
A906B5B01E434872007D12B1 /* Queue.sdef */,
|
||||
2A37F4ABFDCFA73011CA2CEA /* Classes */,
|
||||
2A37F4AFFDCFA73011CA2CEA /* Other Sources */,
|
||||
2A37F4B8FDCFA73011CA2CEA /* Resources */,
|
||||
@@ -502,6 +504,7 @@
|
||||
A9FAC5FE1BAC3BAC00525E42 /* Document */,
|
||||
A9AF6A7818D0537F00FAAB08 /* Queue */,
|
||||
A9915ABB1F4B26A5003C57D1 /* Presets */,
|
||||
A9C51DF32E4B4548003E82E6 /* ScriptCommand.swift */,
|
||||
A9BE561A220307F100FF6BE3 /* Utilities.swift */,
|
||||
A9395E341F8B9ACA004C402B /* MP42FileAdditions.swift */,
|
||||
A91EB968205ABAF400392E1C /* NSWindowAdditions.swift */,
|
||||
@@ -761,7 +764,7 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 1620;
|
||||
LastUpgradeCheck = 1640;
|
||||
TargetAttributes = {
|
||||
8D15AC270486D014006FF6A4 = {
|
||||
LastSwiftMigration = 1020;
|
||||
@@ -839,12 +842,12 @@
|
||||
A9AB486717F0AEFD000AA72E /* SoundView.xib in Resources */,
|
||||
A9F5820C1DCC861F005F3E92 /* Assets.xcassets in Resources */,
|
||||
8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */,
|
||||
A906B5B11E434872007D12B1 /* Queue.sdef in Resources */,
|
||||
A93105391F9758EC00605146 /* FileImportController.xib in Resources */,
|
||||
A9AB486517F0AEFD000AA72E /* EmptyView.xib in Resources */,
|
||||
1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */,
|
||||
A90300C81DAE72C4008237D8 /* PresetPrefsViewController.xib in Resources */,
|
||||
A9C5FA7419FA2FEC0051F3FF /* SBActivityWindow.xib in Resources */,
|
||||
4AFFB6D22DF751110099E229 /* Subler.sdef in Resources */,
|
||||
A90B023B10F3290A000416F3 /* PrefsWindowController.xib in Resources */,
|
||||
A9AB486417F0AEFD000AA72E /* ChapterView.xib in Resources */,
|
||||
A9AB486817F0AEFD000AA72E /* VideoView.xib in Resources */,
|
||||
@@ -939,6 +942,7 @@
|
||||
A9C31E572029A75F00CEF474 /* GeneralPrefsViewController.swift in Sources */,
|
||||
A9AE26C01F3B66470041A57D /* SquaredTVArt.swift in Sources */,
|
||||
A9B1056E2025D9B9009E91FC /* TracksViewController.swift in Sources */,
|
||||
A9C51DF42E4B4548003E82E6 /* ScriptCommand.swift in Sources */,
|
||||
A99B7FD82D53764F0027BCB5 /* AppleTVv3.swift in Sources */,
|
||||
A9B514191EFC12310055A035 /* TheTVDB.swift in Sources */,
|
||||
A9C31E602029A80F00CEF474 /* AdvancedPrefsViewController.swift in Sources */,
|
||||
@@ -1403,7 +1407,7 @@
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1.8.7;
|
||||
CURRENT_PROJECT_VERSION = 1.8.9;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
@@ -1420,7 +1424,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.8.7;
|
||||
MARKETING_VERSION = 1.8.9;
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
|
||||
OTHER_SWIFT_FLAGS = "";
|
||||
@@ -1445,7 +1449,7 @@
|
||||
CODE_SIGN_IDENTITY = "Mac Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1.8.7;
|
||||
CURRENT_PROJECT_VERSION = 1.8.9;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
@@ -1461,7 +1465,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.8.7;
|
||||
MARKETING_VERSION = 1.8.9;
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
|
||||
OTHER_SWIFT_FLAGS = "";
|
||||
@@ -1676,8 +1680,8 @@
|
||||
isa = XCRemoteSwiftPackageReference;
|
||||
repositoryURL = "https://github.com/sparkle-project/Sparkle";
|
||||
requirement = {
|
||||
branch = 2.x;
|
||||
kind = branch;
|
||||
kind = exactVersion;
|
||||
version = 2.7.1;
|
||||
};
|
||||
};
|
||||
/* End XCRemoteSwiftPackageReference section */
|
||||
|
||||
Reference in new issue
Block a user