Skip to content

Commit

Permalink
remove lomo-web and update lomod
Browse files Browse the repository at this point in the history
  • Loading branch information
fuji246 committed Oct 31, 2021
1 parent 6d36a22 commit 0ae8a8e
Show file tree
Hide file tree
Showing 91 changed files with 4 additions and 57 deletions.
4 changes: 0 additions & 4 deletions LomoAgent.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
3AE33D422324CD9300B81C13 /* LomoAgentLauncher.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3A16D9CF231C501F0092EADD /* LomoAgentLauncher.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
3AE5886424569FD40079CB36 /* UserWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3AE5886624569FD40079CB36 /* UserWindow.xib */; };
3AE5886C2456A0F60079CB36 /* UserWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AE5886B2456A0F60079CB36 /* UserWindow.swift */; };
3AE8C8A323A44924009FA2E9 /* lomo-web in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3AE8C8A123A4464C009FA2E9 /* lomo-web */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
3AEB69A92419673300F57177 /* ffmpeg in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3AEB69A82419673300F57177 /* ffmpeg */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
3AEB69AB24196C6F00F57177 /* ffprobe in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3AEB69AA24196C6F00F57177 /* ffprobe */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
3AEB69AD24196C8700F57177 /* ffmpeg in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3AEB69AC24196C8700F57177 /* ffmpeg */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
Expand Down Expand Up @@ -67,7 +66,6 @@
3A23EFCC2422FD3100906032 /* exiftool in CopyFiles */,
3AEB69AB24196C6F00F57177 /* ffprobe in CopyFiles */,
3AEB69A92419673300F57177 /* ffmpeg in CopyFiles */,
3AE8C8A323A44924009FA2E9 /* lomo-web in CopyFiles */,
3AE33D3E23244F6400B81C13 /* lomoupg in CopyFiles */,
3AE33D3B23244F2E00B81C13 /* rsync in CopyFiles */,
3A35C5DA2240B5F30030FF1B /* lomod in CopyFiles */,
Expand Down Expand Up @@ -135,7 +133,6 @@
3AE5886E245948990079CB36 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/UserWindow.strings"; sourceTree = "<group>"; };
3AE58870245949350079CB36 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/MainMenu.strings"; sourceTree = "<group>"; };
3AE5887224594A270079CB36 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/MainMenu.strings; sourceTree = "<group>"; };
3AE8C8A123A4464C009FA2E9 /* lomo-web */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = "lomo-web"; path = "dependencies/lomod/Contents/MacOS/lomo-web"; sourceTree = "<group>"; };
3AEB69A82419673300F57177 /* ffmpeg */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = ffmpeg; path = dependencies/lomod/Contents/MacOS/ffmpeg; sourceTree = "<group>"; };
3AEB69AA24196C6F00F57177 /* ffprobe */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = ffprobe; path = dependencies/lomod/Contents/MacOS/ffprobe; sourceTree = "<group>"; };
3AEB69AC24196C8700F57177 /* ffmpeg */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ffmpeg; path = dependencies/lomod/Contents/Frameworks/ffmpeg; sourceTree = "<group>"; };
Expand Down Expand Up @@ -223,7 +220,6 @@
3A23EFCD2422FD4E00906032 /* lib */,
3AEB69AA24196C6F00F57177 /* ffprobe */,
3AEB69A82419673300F57177 /* ffmpeg */,
3AE8C8A123A4464C009FA2E9 /* lomo-web */,
3AE33D3C23244F5100B81C13 /* lomoupg */,
3A818C152320D36A00B110B3 /* rsync */,
3A1666E526FC599A008F1250 /* lomoc */,
Expand Down
4 changes: 2 additions & 2 deletions LomoAgent/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>d2da71c</string>
<string>6d36a22</string>
<key>CFBundleVersion</key>
<string>2021_09_22.23_44_18.0.d2da71c</string>
<string>2021_10_30.22_30_30.0.6d36a22</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
51 changes: 2 additions & 49 deletions LomoAgent/StatusMenuController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class StatusMenuController: NSObject {
}

@IBAction func importClicked(_ sender: Any) {
let lomoWebPort = String(UserDefaults.standard.integer(forKey: PREF_LOMOD_PORT) + 1)
let lomoWebPort = String(UserDefaults.standard.integer(forKey: PREF_LOMOD_PORT))
if let url = URL(string: "http://" + listenIp + ":" + lomoWebPort) {
NSWorkspace.shared.open(url)
} else {
Expand Down Expand Up @@ -179,9 +179,6 @@ class StatusMenuController: NSObject {
// not found!
if let firstIp = ipList.first {
listenIp = firstIp
// need restart lomo-web
stopLomoWeb()
startLomoWeb()
NotificationCenter.default.post(name: .NotifyIpChanged, object: self)
}
}
Expand Down Expand Up @@ -243,38 +240,8 @@ class StatusMenuController: NSObject {
}
}

func startLomoWeb() {
guard lomoWebTask == nil else {
DDLogInfo("lomo-web already started!")
return
}

lomoWebTask = Process()
if let task = lomoWebTask,
let executablePath = Bundle.main.executableURL?.deletingLastPathComponent() {
let lomoWebPath = executablePath.path + "/lomo-web"
DDLogInfo("lomo-web Path: \(lomoWebPath)")

if let lomodPort = UserDefaults.standard.string(forKey: PREF_LOMOD_PORT) {
let lomoWebPort = UserDefaults.standard.integer(forKey: PREF_LOMOD_PORT) + 1
task.launchPath = lomoWebPath
task.arguments = ["--baseurl", "http://" + listenIp + ":" + lomodPort,
"--port", String(lomoWebPort)]
task.launch()

DDLogInfo("lomo-web is running: \(task.isRunning), pid = \(task.processIdentifier)")
} else {
DDLogError("Need set Lomorage service port first")
lomoWebTask = nil
preferencesWindow.showWindow(nil)
NSApp.activate(ignoringOtherApps: true)
}
}
}

func startLomoService() {
startLomod()
startLomoWeb()
}

func stopLomod() {
Expand All @@ -287,26 +254,12 @@ class StatusMenuController: NSObject {
lomodTask = nil
}

func stopLomoWeb() {
if let task = lomoWebTask, task.isRunning {
DDLogError("lomo-web terminate, pid = \(task.processIdentifier)")
task.terminate()
} else if lomoWebTask != nil {
DDLogError("lomo-web already terminate with error: \(String(describing: lomoWebTask!.terminationReason))")
}
lomoWebTask = nil
}

func stopLomoService() {
stopLomoWeb()
stopLomod()
}

func killLomoService() {
var p = Process.launchedProcess(launchPath: "/usr/bin/killall", arguments: ["lomod"])
p.waitUntilExit()

p = Process.launchedProcess(launchPath: "/usr/bin/killall", arguments: ["lomo-web"])
let p = Process.launchedProcess(launchPath: "/usr/bin/killall", arguments: ["lomod"])
p.waitUntilExit()
}

Expand Down
Binary file added dependencies/.build.sh.swp
Binary file not shown.
2 changes: 0 additions & 2 deletions dependencies/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ EXIFTOOL_LIB=$EXIFTOOL_HOME_ABS/lib

LOMOD_PATH=/Users/jeromy/.go/src/bitbucket.org/lomoware/lomo-backend/cmd/lomod/lomod
LOMOC_PATH=/Users/jeromy/.go/src/bitbucket.org/lomoware/lomo-backend/cmd/lomoc/lomoc
LOMOWEB_PATH=/Users/jeromy/.go/src/github.com/lomorage/lomo-web/lomo-web

# lomoupg and rsync has no dependencies, just copy binaries
LOMOUPG_PATH=/Users/jeromy/.go/src/github.com/lomorage/lomoUpdate/lomoupg
Expand All @@ -38,7 +37,6 @@ cp $EXIFTOOL_PATH $BINARY_DIR
cp -R $EXIFTOOL_LIB $BINARY_DIR
cp $LOMOD_PATH $BINARY_DIR
cp $LOMOC_PATH $BINARY_DIR
cp $LOMOWEB_PATH $BINARY_DIR
cp $LOMOUPG_PATH $BINARY_DIR
cp $RSYNC_PATH $BINARY_DIR

Expand Down
Loading

0 comments on commit 0ae8a8e

Please sign in to comment.