-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix api for piwigo 2.7 (image uploaded without creation date) * implement legacy piwigo_import_tree mecanism (but md5hex is different) * user configuration management: load/save/valid in ui and file * some minor refactoring
- Loading branch information
1 parent
ffd9a31
commit 5884c60
Showing
38 changed files
with
1,016 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
remotesync-api/src/main/java/org/piwigo/remotesync/api/Job.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2014 Matthieu Helleboid. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the GNU Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html | ||
* | ||
* Contributors: | ||
* Matthieu Helleboid - initial API and implementation | ||
******************************************************************************/ | ||
package org.piwigo.remotesync.api; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public abstract class Job { | ||
|
||
private static final Logger logger = LoggerFactory.getLogger(Job.class); | ||
private static boolean running; | ||
|
||
public synchronized void execute() { | ||
logger.debug("running " + running); | ||
if (running) { | ||
logger.info("Already running"); | ||
return; | ||
} | ||
running = true; | ||
|
||
try { | ||
doExecute(); | ||
} catch (Exception e) { | ||
// FIXME | ||
} finally { | ||
running = false; | ||
} | ||
} | ||
|
||
public void executeInThread() { | ||
new Thread(new Runnable() { | ||
|
||
public void run() { | ||
execute(); | ||
} | ||
}).start(); | ||
} | ||
|
||
protected abstract void doExecute(); | ||
|
||
public boolean isRunning() { | ||
return running; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
136 changes: 0 additions & 136 deletions
136
remotesync-api/src/main/java/org/piwigo/remotesync/api/Sync.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.