Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
24334c6
Funding update
andrey18106 Oct 31, 2021
9f6ba59
Fixed: user shared, webdav shares, local shares files scan.
bigcat88 Nov 20, 2021
7e26014
Fix for #28
bigcat88 Nov 29, 2021
7fae37d
Update pylint config file.
bigcat88 Nov 30, 2021
3e6de8f
MediaDC 0.1.8 features. Batch editing. Bug fixes
andrey18106 Dec 2, 2021
4e4015a
Removed npm audit from required for check
andrey18106 Dec 2, 2021
e713f4f
Increased supported Nextcloud version
andrey18106 Dec 2, 2021
e05f875
Installation check fix
andrey18106 Dec 3, 2021
a67c5a8
Screenshots update.
bigcat88 Dec 3, 2021
6d7285c
Added new screenshot.
bigcat88 Dec 3, 2021
2b56d9d
Minor fixes
andrey18106 Dec 9, 2021
54855a1
Merge branch 'dev' of https://github.com/andrey18106/mediadc into dev
andrey18106 Dec 9, 2021
493f7fc
Minor changes
andrey18106 Dec 13, 2021
048a15c
Fixed deselection
andrey18106 Dec 14, 2021
82f0c41
Removed debug stuff.
bigcat88 Dec 15, 2021
406511f
Bug fixes. Added option auto opening of the next group #30
andrey18106 Dec 15, 2021
250ceb2
Error messages output fixes
andrey18106 Dec 16, 2021
129bdb2
Minor changes
andrey18106 Dec 17, 2021
fb08bb1
Added output to errors
andrey18106 Dec 17, 2021
6703720
Psalm fix
andrey18106 Dec 17, 2021
265a0bf
Update description of python_command.
bigcat88 Dec 17, 2021
13cca6b
Some bug fixes
andrey18106 Dec 18, 2021
e52b2ce
Minor changes on error messages
andrey18106 Dec 20, 2021
539f696
Removed log
andrey18106 Dec 20, 2021
3465699
Changed boost package availability
andrey18106 Dec 20, 2021
600c834
Output messages fixes
andrey18106 Dec 20, 2021
4b9b671
User rights changes
andrey18106 Dec 20, 2021
fae6b2a
MediaDC 0.1.8 changes
andrey18106 Dec 20, 2021
3b0c43f
Removed documentation label from stale workflow
andrey18106 Dec 20, 2021
2a0a24c
API permissions update
andrey18106 Dec 20, 2021
a93d179
Psalm fix
andrey18106 Dec 20, 2021
90a2891
Updated changelog
andrey18106 Dec 20, 2021
9d55c10
Support info update
andrey18106 Dec 20, 2021
c823f51
Updated screenshots
andrey18106 Dec 20, 2021
412f6ae
Changed make command for production build
andrey18106 Dec 21, 2021
8754cae
null error bug fix
andrey18106 Dec 21, 2021
d60203b
Postgre slash fix. #44
bigcat88 Jan 12, 2022
7608251
now no clearing dbhost value, `usock` var always have a higher prior…
bigcat88 Jan 12, 2022
399b8a7
Merge branch 'main' into dev
andrey18106 Jan 25, 2022
9700d7f
this probably will fix that situation #47
bigcat88 Jan 27, 2022
e79d7e5
pylint: max-returns from 6 to 8
bigcat88 Jan 27, 2022
2e50980
#47 addition check not to save to table too large values.
bigcat88 Jan 27, 2022
aa74974
#48
bigcat88 Jan 27, 2022
2911a6f
Merge branch 'dev' of https://github.com/andrey18106/mediadc into dev
andrey18106 Feb 3, 2022
9da6cef
Minor changes
andrey18106 Feb 3, 2022
57b19c2
Added task finish notification. Minor refactoring and fixes
andrey18106 Feb 3, 2022
3bb011f
mediadc:collector:tasks:notify
bigcat88 Feb 5, 2022
94c2d48
mediadc:collector:tasks:notify
bigcat88 Feb 5, 2022
8b4aab0
max-branches from 12 -> 14
bigcat88 Feb 5, 2022
4185bb6
small adjustment if task_info does not contain those fields.
bigcat88 Feb 5, 2022
62473d6
Added missed setting
andrey18106 Feb 5, 2022
4eb6f5b
f%ng php cli. =)
bigcat88 Feb 5, 2022
6b60be6
Merge remote-tracking branch 'origin/dev' into dev
bigcat88 Feb 5, 2022
2a06e25
Fixed typo
andrey18106 Feb 5, 2022
bb35a5e
Updated bug report info
andrey18106 Feb 7, 2022
8262d1f
Using new pillow_heif 0.1.6 functions.
bigcat88 Feb 9, 2022
49b18da
Merge remote-tracking branch 'origin/dev' into dev
bigcat88 Feb 9, 2022
a4ec04c
Minor fixes
andrey18106 Feb 14, 2022
d3e9f74
MediaDC 0.1.9 changelog
andrey18106 Feb 14, 2022
d6945fc
Workflow update
andrey18106 Feb 14, 2022
a0c9a29
Revert changes back, till version 0.2.0
bigcat88 Feb 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If your issue appears to be a bug, and hasn't been reported, open a new issue.

Help us to maximize the effort we can spend fixing issues and adding new features, by not reporting duplicate issues.

[template]: https://raw.github.com/andrey18106/main/.github/ISSUE_TEMPLATE/bug_report.md
[template]: https://raw.githubusercontent.com/andrey18106/mediadc/main/.github/ISSUE_TEMPLATE/bug_report.md

## Contributing to Source Code

Expand Down
23 changes: 8 additions & 15 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
2. Click on '...'
3. Scroll down to '...'
4. See error

**Expected behavior**
Expand All @@ -20,20 +20,13 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS [e.g. iOS]
- CPU (architecture)
- Browser [e.g. chrome, safari]
- Nextcloud version [e.g. 22]
- Database configuration (without sensitive information)
- OS [e.g. Ubuntu]
- CPU [architecture x86, ARM]
- Browser [e.g. chrome, firefox, safari]
- Nextcloud version [e.g. 23]
- Database configuration [e.g. mysql 8.0.27, without sensitive information]
- Python version [e.g. 3.9.1]
- MediaDC version [e.g. 0.1.0]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS 8.1]
- Browser [e.g. stock browser, safari]
- Nextcloud version [e.g. 22]
- MediaDC version [e.g. 0.1.0]
- MediaDC version [e.g. 0.1.9]

**Additional context**
Add any other context about the problem here.
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Close stale issues'

on:
schedule:
- cron: '0 10 * * 0' # Every day at 12:00 PM GMT+2
- cron: '0 12 * * 0' # Every Sunday at 12:00 PM UTC
workflow_dispatch:

jobs:
Expand All @@ -14,7 +14,7 @@ jobs:
days-before-stale: 28
days-before-close: 14
days-before-pr-close: -1 # Never close PR's automatically
only-labels: 'bug, question'
only-labels: 'bug, question, Fixed for upcoming version'
stale-issue-message: 'This issue did not receive an update in the last 4 weeks.
Please take a look again and update the issue with new details,
otherwise it will be automatically closed in 2 weeks. Thank you!'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
run: composer run psalm

npm-audit:
needs: [changes, linters-js]
# needs: [changes, linters-js]
if: ${{ needs.changes.outputs.js_src == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
name: npm-audit
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [7.4, 8.0]
nextcloud-versions: ['stable21', 'stable22', 'master']
php-versions: [7.3, 7.4, 8.0]
nextcloud-versions: ['stable21', 'stable22', 'stable23', 'master']

name: Nextcloud ${{ matrix.nextcloud-versions }} php ${{ matrix.php-versions }} unit tests
steps:
Expand Down Expand Up @@ -62,8 +62,8 @@ jobs:
strategy:
matrix:
python-versions: [3.7, 3.8, 3.9]
php-versions: [7.4, 8.0]
nextcloud-versions: ['stable21', 'stable22', 'master']
php-versions: [7.3, 7.4, 8.0]
nextcloud-versions: ['stable21', 'stable22', 'stable23', 'master']

name: Nextcloud ${{ matrix.nextcloud-versions }} (php${{ matrix.php-versions }}) python ${{ matrix.python-versions }} unit tests
steps:
Expand Down
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ max-attributes=9
max-bool-expr=5

# Maximum number of branch for function / method body.
max-branches=12
max-branches=14

# Maximum number of locals for function / method body.
max-locals=15
Expand All @@ -401,7 +401,7 @@ max-parents=7
max-public-methods=20

# Maximum number of return / yield for function / method body.
max-returns=6
max-returns=8

# Maximum number of statements in function / method body.
max-statements=50
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

All notable changes to this project will be documented in this file.

## [0.1.9 - 2022-02-14]

### Added

- Added Task finish notification option
- Added Bug report section to Admin settings for quick system info collection

### Changed

- Boost package hexhamming was updated. Now available on arm8 cpu and on Alpine Linux too.

### Fixed

- Fixed Python error: Out of range value for column `duration` (https://github.com/andrey18106/mediadc/issues/47)
- Fixed error "ffmpeg not found" when it was builded from source (thanks for issue to @sergeng)
- Fixed connect error when using Nextcloud Docker with MariaDB (thanks for issue to @Bennneeeet)
- Fixed connect error in some situations when using PGSQL with socket (thanks for issue to @pricly-yellow)

## [0.1.8 - 2021-12-20]

Updated `python_command` setting from alias to full/absolute path to the Python. PHP-FPM users should check and update it on Administration settings page if install fails on Configuration page
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

**📸📹 Collect photo and video duplicates to save your cloud storage space**

| **Not working on FreeBSD systems for now**

![Home page](/screenshots/task-managment.png)
![Home page](/screenshots/task-results.png)
Nextcloud Media Duplicate Collector application
Expand Down
3 changes: 2 additions & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This app allows to find duplicate or similar 📸📹 photos and videos
Quick start guide and further information in our [Wiki](https://github.com/andrey18106/mediadc/wiki).
]]>
</description>
<version>0.1.8</version>
<version>0.1.9</version>
<licence>agpl</licence>
<author mail="andrey18106x@gmail.com" homepage="https://github.com/andrey18106">Andrey Borysenko</author>
<author mail="bigcat88@icloud.com" homepage="https://github.com/bigcat88">Alexander Piskun</author>
Expand Down Expand Up @@ -58,6 +58,7 @@ Quick start guide and further information in our [Wiki](https://github.com/andre
<commands>
<command>OCA\MediaDC\Command\CollectorFileContentsCommand</command>
<command>OCA\MediaDC\Command\CollectorCleanupCommand</command>
<command>OCA\MediaDC\Command\CollectorTaskNotificationCommand</command>
</commands>
<background-jobs>
<job>OCA\MediaDC\BackgroundJob\CollectorCleanupJob</job>
Expand Down
1 change: 1 addition & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
['name' => 'settings#getSettingByName', 'url' => '/api/v1/settings/name/{name}', 'verb' => 'GET'],
['name' => 'settings#updateSetting', 'url' => '/api/v1/settings/name/{name}', 'verb' => 'PUT'],
['name' => 'settings#truncate', 'url' => '/api/v1/settings/truncate/{name}', 'verb' => 'POST'],
['name' => 'settings#systemInfo', 'url' => '/api/v1/system-info', 'verb' => 'GET'],

// Python API
['name' => 'python#check', 'url' => '/api/v1/python/check', 'verb' => 'GET'],
Expand Down
4 changes: 2 additions & 2 deletions js/mediadc-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/mediadc-main.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/mediadc-settings.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/mediadc-settings.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/mediadc-src_views_Configuration_vue.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/mediadc-src_views_Configuration_vue.js.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,27 @@
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\Notification\IManager;

use OCA\MediaDC\Dashboard\RecentTasksWidget;


class Application extends App implements IBootstrap {

public const APP_ID = 'mediadc';

/** @var IManager */
private $notificationManager;

public function __construct() {
parent::__construct(self::APP_ID);

$this->notificationManager = \OC::$server->get(\OCP\Notification\IManager::class);
}

public function register(IRegistrationContext $context): void {
$context->registerDashboardWidget(RecentTasksWidget::class);
$this->notificationManager->registerNotifierService(\OCA\MediaDC\Notification\Notifier::class);
}

public function boot(IBootContext $context): void {
Expand Down
3 changes: 1 addition & 2 deletions lib/Command/CollectorCleanupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ class CollectorCleanupCommand extends Command {
/** @var CollectorService */
private $collectorService;

public function __construct(CollectorService $collectorService)
{
public function __construct(CollectorService $collectorService) {
parent::__construct();

$this->collectorService = $collectorService;
Expand Down
3 changes: 1 addition & 2 deletions lib/Command/CollectorFileContentsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ class CollectorFileContentsCommand extends Command {
/** @var LoggerInterface */
private $logger;

public function __construct(IRootFolder $rootFolder, LoggerInterface $logger)
{
public function __construct(IRootFolder $rootFolder, LoggerInterface $logger) {
parent::__construct();

$this->rootFolder = $rootFolder;
Expand Down
102 changes: 102 additions & 0 deletions lib/Command/CollectorTaskNotificationCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?php

declare(strict_types=1);

/**
* @copyright Copyright (c) 2021 Andrey Borysenko <andrey18106x@gmail.com>
*
* @copyright Copyright (c) 2021 Alexander Piskun <bigcat88@icloud.com>
*
* @author 2021 Andrey Borysenko <andrey18106x@gmail.com>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

namespace OCA\MediaDC\Command;

use OCA\MediaDC\AppInfo\Application;
use OCA\MediaDC\Db\CollectorTask;
use OCA\MediaDC\Db\CollectorTaskDetail;
use OCA\MediaDC\Db\CollectorTaskDetailMapper;
use OCA\MediaDC\Service\CollectorService;
use OCP\IURLGenerator;
use OCP\Notification\IManager;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;


class CollectorTaskNotificationCommand extends Command {

public const ARGUMENT_TASK_ID = 'task_id';
public const ARGUMENT_TASK_STATUS = 'status';

/** @var CollectorService */
private $collectorService;

/** @var IManager */
private $notificationManager;

/** @var CollectorTaskDetailMapper */
private $taskDetailsMapper;

public function __construct(CollectorService $collectorService,
CollectorTaskDetailMapper $taskDetailsMapper,
IManager $notificationManager, IURLGenerator $urlGenerator) {
parent::__construct();

$this->collectorService = $collectorService;
$this->taskDetailsMapper = $taskDetailsMapper;
$this->notificationManager = $notificationManager;
$this->url = $urlGenerator;
}

protected function configure(): void {
$this->setName("mediadc:collector:tasks:notify");
$this->setDescription("Sends task finished notification to the user");
$this->addArgument(self::ARGUMENT_TASK_ID, InputArgument::REQUIRED);
$this->addArgument(self::ARGUMENT_TASK_STATUS, InputArgument::REQUIRED);
}

protected function execute(InputInterface $input, OutputInterface $output): int {
$taskId = $input->getArgument(self::ARGUMENT_TASK_ID);
$status = $input->getArgument(self::ARGUMENT_TASK_STATUS);
/** @var CollectorTask */
$collectorTask = $this->collectorService->get(intval($taskId));
$collectorDetails = $this->taskDetailsMapper->findAllById(intval($taskId));
$duplicates = 0;
/** @var CollectorTaskDetail */
foreach ($collectorDetails as $detail) {
$duplicates += count(json_decode($detail->getGroupFilesIds()));
}
$notification = $this->notificationManager->createNotification();

$notification->setApp(Application::APP_ID)
->setUser($collectorTask->getOwner())
->setDateTime(new \DateTime())
->setObject('mediadc-task', $taskId)
->setSubject('mediadc-task-alert', [
'status' => $status,
'duplicate-groups' => count($collectorDetails),
'duplicates' => $duplicates,
]);
$this->notificationManager->notify($notification);
return 0;
}

}
17 changes: 16 additions & 1 deletion lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use OCA\MediaDC\AppInfo\Application;
use OCA\MediaDC\Service\PhotosService;
use OCA\MediaDC\Service\SettingsService;
use OCA\MediaDC\Service\UtilsService;
use OCA\MediaDC\Service\VideosService;


Expand All @@ -50,13 +51,18 @@ class SettingsController extends Controller {
/** @var VideosService */
private $videosService;

/** @var UtilsService */
private $utils;

public function __construct(IRequest $request, SettingsService $service,
PhotosService $photosService, VideosService $videosService) {
PhotosService $photosService, VideosService $videosService,
UtilsService $utils) {
parent::__construct(Application::APP_ID, $request);

$this->service = $service;
$this->photosService = $photosService;
$this->videosService = $videosService;
$this->utils = $utils;
}

/**
Expand Down Expand Up @@ -131,4 +137,13 @@ public function truncate($name): JSONResponse {
}
}

/**
* @NoCSRFRequired
*
* @return JSONResponse
*/
public function systemInfo(): JSONResponse {
return new JSONResponse($this->utils->getSystemInfo(), Http::STATUS_OK);
}

}
Loading