Merge commit '1c99d0a4681b983cd51233e050311ca99691740e'
# Conflicts: # src/main/java/de/jeyp91/tippligaforum/MatchesListForumUpdater.java
This commit is contained in:
44
.classpath
44
.classpath
@@ -1,44 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="optional" value="true"/>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="optional" value="true"/>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
<attribute name="test" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="src" path="target/generated-sources/annotations">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="optional" value="true"/>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
<attribute name="ignore_optional_problems" value="true"/>
|
|
||||||
<attribute name="m2e-apt" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="optional" value="true"/>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
<attribute name="ignore_optional_problems" value="true"/>
|
|
||||||
<attribute name="m2e-apt" value="true"/>
|
|
||||||
<attribute name="test" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
|
||||||
</classpath>
|
|
||||||
23
.project
23
.project
@@ -1,23 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>tlw-database-tool</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
||||||
@@ -1,12 +1,17 @@
|
|||||||
package de.jeyp91.tippligaforum;
|
package de.jeyp91.tippligaforum;
|
||||||
|
|
||||||
|
import de.jeyp91.App;
|
||||||
import de.jeyp91.apifootball.APIFootballUpdater;
|
import de.jeyp91.apifootball.APIFootballUpdater;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
public class MatchesListForumUpdater {
|
public class MatchesListForumUpdater {
|
||||||
private HashSet<Integer> leagues;
|
private HashSet<Integer> leagues;
|
||||||
|
private static final Logger logger = LogManager.getLogger(MatchesListForumUpdater.class);
|
||||||
|
|
||||||
public MatchesListForumUpdater(int season) {
|
public MatchesListForumUpdater(int season) {
|
||||||
this.leagues = new APIFootballUpdater().getLeagues(season);
|
this.leagues = new APIFootballUpdater().getLeagues(season);
|
||||||
@@ -22,9 +27,11 @@ public class MatchesListForumUpdater {
|
|||||||
MatchesListCreator creator = new MatchesListCreator(league);
|
MatchesListCreator creator = new MatchesListCreator(league);
|
||||||
String content = creator.getMatchesBeautiful();
|
String content = creator.getMatchesBeautiful();
|
||||||
String contentWithCodeBBCode = "<r><CODE><s>[code]</s>" + content + "<e>[/code]</e></CODE></r>";
|
String contentWithCodeBBCode = "<r><CODE><s>[code]</s>" + content + "<e>[/code]</e></CODE></r>";
|
||||||
int postId = getPostId(season, creator.getCountry(), creator.getLeagueName());
|
Integer postId = getPostId(season, creator.getCountry(), creator.getLeagueName());
|
||||||
TippligaSQLConnector con = TippligaSQLConnector.getInstance();
|
if(postId != null) {
|
||||||
con.updatePost(postId, contentWithCodeBBCode);
|
TippligaSQLConnector con = TippligaSQLConnector.getInstance();
|
||||||
|
con.updatePost(postId, contentWithCodeBBCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer getPostId(int season, String country, String league) {
|
private Integer getPostId(int season, String country, String league) {
|
||||||
@@ -40,7 +47,8 @@ public class MatchesListForumUpdater {
|
|||||||
rset.next();
|
rset.next();
|
||||||
postId = Integer.parseInt(rset.getString(1));
|
postId = Integer.parseInt(rset.getString(1));
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
logger.error("Could not find post for " + country + " - " + league + ".");
|
||||||
|
logger.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return postId;
|
return postId;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user