Store the insert URI in the information used for inserting.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / SoneDownloader.java
index 6eaa1b0..eb263ed 100644 (file)
@@ -182,7 +182,7 @@ public class SoneDownloader extends AbstractService {
                        soneInputStream = soneBucket.getInputStream();
                        Sone parsedSone = parseSone(originalSone, soneInputStream);
                        if (parsedSone != null) {
-                               parsedSone.setLatestEdition(requestUri.getEdition());
+                               parsedSone.modify().setLatestEdition(requestUri.getEdition()).update();
                        }
                        return parsedSone;
                } catch (Exception e1) {
@@ -203,11 +203,9 @@ public class SoneDownloader extends AbstractService {
         * @param soneInputStream
         *            The input stream to parse the Sone from
         * @return The parsed Sone
-        * @throws SoneException
-        *             if a parse error occurs, or the protocol is invalid
         */
-       public Sone parseSone(Sone originalSone, InputStream soneInputStream) throws SoneException {
-               return new SoneParser(core).parseSone(originalSone, soneInputStream);
+       public Sone parseSone(Sone originalSone, InputStream soneInputStream) {
+               return new SoneParser().parseSone(core.getDatabase(), originalSone, soneInputStream);
        }
 
        //