Skip to content

Commit

Permalink
Merge develop into master.v0.3.1 (8a7d60f)
Browse files Browse the repository at this point in the history
  • Loading branch information
xjbeta committed Aug 28, 2018
2 parents 1ee41af + 690a3a4 commit db11f0d
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 12 deletions.
23 changes: 23 additions & 0 deletions iina+.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
01AEC8BE20EE108B001406E8 /* Processes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01AEC8BD20EE108B001406E8 /* Processes.swift */; };
01AEC8C220EFBCCF001406E8 /* MPVOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01AEC8C120EFBCCF001406E8 /* MPVOption.swift */; };
01AEC8C920F1081C001406E8 /* Identifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01AEC8C820F1081C001406E8 /* Identifiers.swift */; };
01C232E92134FABC0021C28F /* ykdl in Copy Executables */ = {isa = PBXBuildFile; fileRef = 01C232E72134FAB20021C28F /* ykdl */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
01E6A09C211AD62800C6EF98 /* VideoDurationFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01E6A09B211AD62800C6EF98 /* VideoDurationFormatter.swift */; };
01F46CA12102EF4600FE9DAD /* GereralViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F46CA02102EF4600FE9DAD /* GereralViewController.swift */; };
01F5151A2109F002007C7153 /* LiveStatusTableCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F515192109F002007C7153 /* LiveStatusTableCellView.swift */; };
Expand All @@ -75,6 +76,17 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
01C232E52134EBDD0021C28F /* Copy Executables */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 6;
files = (
01C232E92134FABC0021C28F /* ykdl in Copy Executables */,
);
name = "Copy Executables";
runOnlyForDeploymentPostprocessing = 0;
};
01F6C4EA213396560009672A /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -140,6 +152,7 @@
01AEC8BD20EE108B001406E8 /* Processes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Processes.swift; sourceTree = "<group>"; };
01AEC8C120EFBCCF001406E8 /* MPVOption.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MPVOption.swift; sourceTree = "<group>"; };
01AEC8C820F1081C001406E8 /* Identifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Identifiers.swift; sourceTree = "<group>"; };
01C232E72134FAB20021C28F /* ykdl */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = ykdl; sourceTree = "<group>"; };
01E6A09B211AD62800C6EF98 /* VideoDurationFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoDurationFormatter.swift; sourceTree = "<group>"; };
01F46CA02102EF4600FE9DAD /* GereralViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GereralViewController.swift; sourceTree = "<group>"; };
01F46CDC2108C55C00FE9DAD /* iina+.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "iina+.entitlements"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -265,6 +278,14 @@
path = SelectVideoCollectionView;
sourceTree = "<group>";
};
016792F1212E57F6003517A7 /* Executables */ = {
isa = PBXGroup;
children = (
01C232E72134FAB20021C28F /* ykdl */,
);
path = Executables;
sourceTree = "<group>";
};
01AEC89E20EDFD01001406E8 = {
isa = PBXGroup;
children = (
Expand All @@ -286,6 +307,7 @@
isa = PBXGroup;
children = (
01F46CDC2108C55C00FE9DAD /* iina+.entitlements */,
016792F1212E57F6003517A7 /* Executables */,
01AEC8BA20EDFD3F001406E8 /* Assets */,
010F0F2E20FF414E00F33553 /* Core Data */,
012601722119BA6D00C9C639 /* Utils */,
Expand Down Expand Up @@ -333,6 +355,7 @@
010F0F0F20FCC1D200F33553 /* CopyFiles */,
019BFF5D212485B900E715CC /* ShellScript */,
01F6C4EA213396560009672A /* Embed Frameworks */,
01C232E52134EBDD0021C28F /* Copy Executables */,
);
buildRules = (
);
Expand Down
Binary file added iina+/Executables/ykdl
Binary file not shown.
2 changes: 1 addition & 1 deletion iina+/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.3</string>
<string>0.3.1</string>
<key>CFBundleVersion</key>
<string>0</string>
<key>LSApplicationCategoryType</key>
Expand Down
21 changes: 20 additions & 1 deletion iina+/Utils/Processes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ class Processes: NSObject {

static let shared = Processes()

private var internalYKDL: String? {
get {
var path = Bundle.main.executablePath
path?.deleteLastPathComponent()
if let path = path {
return path + "/ykdl"
}
return nil
}
}

fileprivate override init() {
}

Expand Down Expand Up @@ -48,7 +59,15 @@ class Processes: NSObject {
let errorPipe = Pipe()
decodeTask?.standardError = errorPipe
decodeTask?.standardOutput = pipe
decodeTask?.launchPath = which(Preferences.shared.liveDecoder.rawValue).first ?? ""

switch Preferences.shared.liveDecoder {
case .internalYKDL:
decodeTask?.launchPath = internalYKDL
case .ykdl, .youget:
decodeTask?.launchPath = which(Preferences.shared.liveDecoder.rawValue).first ?? ""
case .internal😀:
return
}
decodeTask?.arguments = ["--json", url]
decodeTask?.launch()

Expand Down
13 changes: 8 additions & 5 deletions iina+/Views/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,15 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<gridView fixedFrame="YES" xPlacement="leading" yPlacement="bottom" rowAlignment="none" translatesAutoresizingMaskIntoConstraints="NO" id="xbe-XG-bo4">
<rect key="frame" x="69" y="44" width="163" height="48"/>
<rect key="frame" x="59" y="44" width="183" height="48"/>
<autoresizingMask key="autoresizingMask"/>
<rows>
<gridRow id="iFP-QQ-zUF"/>
<gridRow id="W10-gq-hnz"/>
</rows>
<columns>
<gridColumn width="57" id="kXZ-Cg-Mew"/>
<gridColumn width="100" id="vpq-Hh-Xri"/>
<gridColumn width="120" id="vpq-Hh-Xri"/>
</columns>
<gridCells>
<gridCell row="iFP-QQ-zUF" column="kXZ-Cg-Mew" xPlacement="trailing" yPlacement="center" id="EeS-TQ-nlM">
Expand Down Expand Up @@ -363,19 +363,22 @@
</gridCell>
<gridCell row="W10-gq-hnz" column="vpq-Hh-Xri" id="1fZ-3u-Bpj">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0Y9-RS-vhV">
<rect key="frame" x="61" y="-3" width="95" height="26"/>
<rect key="frame" x="61" y="-3" width="111" height="26"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="90" id="Pn9-wq-fB2"/>
</constraints>
<popUpButtonCell key="cell" type="push" title="ykdl" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="VL0-EI-LMe" id="Odr-14-Fna">
<popUpButtonCell key="cell" type="push" title="internal ykdl" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="8Bd-pk-taY" id="Odr-14-Fna">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="KEB-ni-SPc">
<items>
<menuItem title="internal" enabled="NO" id="DiM-ml-jgm">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="ykdl" state="on" id="VL0-EI-LMe"/>
<menuItem title="internal ykdl" state="on" id="8Bd-pk-taY">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="ykdl" id="VL0-EI-LMe"/>
<menuItem title="you-get" id="kaw-nE-b3T"/>
</items>
<connections>
Expand Down
15 changes: 10 additions & 5 deletions iina+/Views/Preferences/GereralViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ enum LivePlayer: String {

enum LiveDecoder: String {
case internal😀
case internalYKDL
case ykdl
case youget = "you-get"

init(raw: String) {
if let decoder = LiveDecoder.init(rawValue: raw) {
if let decoder = LiveDecoder(rawValue: raw) {
self = decoder
} else {
self = .ykdl
self = .internalYKDL
}
}

Expand All @@ -94,20 +95,24 @@ enum LiveDecoder: String {
case 0:
self = .internal😀
case 2:
self = .ykdl
case 3:
self = .youget
default:
self = .ykdl
self = .internalYKDL
}
}

func index() -> Int {
switch self {
case .internal😀:
return 0
case .ykdl:
case .internalYKDL:
return 1
case .youget:
case .ykdl:
return 2
case .youget:
return 3
}
}
}

0 comments on commit db11f0d

Please sign in to comment.