diff --git a/app/src/main/java/com/xypower/mpapp/MainActivity.java b/app/src/main/java/com/xypower/mpapp/MainActivity.java index 4d76e1e7..2f5dc42b 100644 --- a/app/src/main/java/com/xypower/mpapp/MainActivity.java +++ b/app/src/main/java/com/xypower/mpapp/MainActivity.java @@ -577,16 +577,18 @@ public class MainActivity extends AppCompatActivity { if (!tempFile.exists()) { tempFile.mkdirs(); } - File photoFile = new File(tempFile, Integer.toString(channel) + "-img.jpg"); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss"); + Date dt = new Date(); + + File photoFile = new File(tempFile, "IMG-" + Integer.toString(channel) + "-" + simpleDateFormat.format(dt) + (photoOrVideo ? ".jpg" : ".mp4")); if (photoFile.exists()) { photoFile.delete(); } - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - Date dt = new Date(); - String leftTopOsd = simpleDateFormat2.format(dt); + File configFile = new File(appPath); + configFile = new File(configFile, "data/channels/" + Integer.toString(channel) + ".json"); - MicroPhotoService.takePhoto(channel, preset, channel - 1, (channel == 4), photoFile.getAbsolutePath(), leftTopOsd, null, null, null); + MicroPhotoService.takePhoto(channel, preset, photoOrVideo, configFile.getAbsolutePath(), photoFile.getAbsolutePath()); } else { MicroPhotoService.takePhoto(this.getApplicationContext(), channel, preset, photoOrVideo); }