Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First try #1

Merged
merged 6 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: [
'@nextcloud'
],
globals: {
appName: true
}
};
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
js/* binary
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DS_Store
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln

.marginalia

build/
coverage/
vendor
.php_cs.cache

__pycache__
local
1 change: 1 addition & 0 deletions .l10nignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
js/
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
17 changes: 17 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

require_once './vendor/autoload.php';

use Nextcloud\CodingStandard\Config;

$config = new Config();
$config
->getFinder()
->notPath('build')
->notPath('l10n')
->notPath('src')
->notPath('vendor')
->in(__DIR__);
return $config;
52 changes: 52 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
all: dev-setup lint build-js-production test

# Dev env management
dev-setup: clean clean-dev npm-init

npm-init:
npm ci

npm-update:
npm update

# Building
build-js:
npm run dev

build-js-production:
npm run build

watch-js:
npm run watch

# Testing
test:
npm run test

test-watch:
npm run test:watch

test-coverage:
npm run test:coverage

# Linting
lint:
npm run lint

lint-fix:
npm run lint:fix

# Style linting
stylelint:
npm run stylelint

stylelint-fix:
npm run stylelint:fix

# Cleaning
clean:
rm -rf js

clean-dev:
rm -rf node_modules

35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Nextcloud MediaDC

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

![Home page](/screenshots/screenshot.png)
Nextcloud Media Duplicate Collector application

## Why is this so awesome?

* **♻ Delete a huge amount of duplicate photos/videos with different resolutions, sizes and formats**
* **💡 Easily save your cloud storage space and time for sorting**
* **⚙ Flexible configuration**

## 🚀 Installation

In your Nextcloud, simply enable the MediaDC app through the Apps management
and configure application dependencies on Configuration page (only for administrators).
The Nextcloud MediaDC app is only included in nextcloud v21 and higher.

## Maintainers

* [Andrey Borysenko](https://github.com/andrey18106)
* [Alexander Piskun](https://github.com/bigcat88)

If you'd like to join, just go through the [issues list](https://github.com/andrey18106/mediadc/issues) and fix some!

## 🏗 Development setup

To start working on frontend follow this steps:

1. ☁ Clone this into your `apps` folder of your Nextcloud.
1. 👩‍💻 In a terminal, run the command `make dev-setup` to install the dependencies.
1. 🏗 Then to build the frontend application run `make build-js` (builds Vue application in production mode), or watch changes with: `make watch-js` (in development mode).
1. ✅ Enable the app through the app management of your Nextcloud.
1. 💻 Fix easily linting issues with `npm run lint:fix`.
47 changes: 47 additions & 0 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0"?>
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>mediadc</id>
<name>MediaDC</name>
<summary>Nextcloud Media Duplicate Collector application</summary>
<description>**📸📹 Collect photo and video duplicates to save your cloud storage**</description>
<version>0.1.0</version>
<licence>agpl</licence>
<author mail="andrey18106x@gmail.com" homepage="https://github.com/andrey18106">Andrey Borysenko</author>
<author mail="bigcat88@icloud.com">Alexander Piskun</author>
<namespace>MediaDC</namespace>
<documentation>
<admin>https://gitlab.com/andrey18106x/mediadc-dev/-/wikis/home</admin>
</documentation>
<category>tools</category>
<website>https://github.com/andrey18106/mediadc</website>
<bugs>https://github.com/andrey18106/mediadc/issues</bugs>
<repository type="git">https://github.com/andrey18106/mediadc.git</repository>
<screenshot>https://github.com/andrey18106/mediadc/blob/6e1a0590936da4c988ccf10101c13bfa6d1f0866/screenshots/screenshot.png</screenshot>
<dependencies>
<nextcloud min-version="21" max-version="22" />
<python min-version="3.6.8" />
</dependencies>
<settings>
<admin>OCA\MediaDC\Settings\AdminSettings</admin>
</settings>
<repair-steps>
<install>
<step>OCA\MediaDC\Migration\AppDataInitializationStep</step>
</install>
</repair-steps>
<commands>
<command>OCA\MediaDC\Command\CollectorFileContentsCommand</command>
<command>OCA\MediaDC\Command\CollectorCleanupCommand</command>
</commands>
<background-jobs>
<job>OCA\Mediadc\BackgroundJob\CollectorCleanupJob</job>
</background-jobs>
<navigations>
<navigation>
<name>MediaDC</name>
<route>mediadc.page.index</route>
<order>1</order>
</navigation>
</navigations>
</info>
59 changes: 59 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php
/**
* @copyright 2021 Andrey Borysenko <andrey18106x@gmail.com>
* @copyright 2021 Alexander Piskun <bigcat88@icloud.com>
*
* @author Andrey Borysenko <andrey18106x@gmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* 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/>.
*
*/

return [
'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'page#index', 'url' => '/tasks/{taskId}', 'verb' => 'GET', 'postfix' => 'collector'],
['name' => 'page#index', 'url' => '/configuration', 'verb' => 'GET', 'postfix' => 'configuration'],

// SETTINGS API
['name' => 'settings#index', 'url' => '/api/v1/settings', 'verb' => 'GET'],
['name' => 'settings#update', 'url' => '/api/v1/settings', 'verb' => 'PUT'],
['name' => 'settings#settingById', 'url' => '/api/v1/settings/{id}', 'verb' => 'GET'],
['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'],

// Python API
['name' => 'python#check', 'url' => '/api/v1/python/check', 'verb' => 'GET'],
['name' => 'python#install', 'url' => '/api/v1/python/install', 'verb' => 'GET'],
['name' => 'python#installDepsList', 'url' => '/api/v1/python/install/{listName}', 'verb' => 'POST'],
['name' => 'python#updateDepsList', 'url' => '/api/v1/python/update', 'verb' => 'POST'],
['name' => 'python#deleteDepsList', 'url' => '/api/v1/python/delete', 'verb' => 'POST'],

// COLLECTOR API
['name' => 'collector#index', 'url' => '/api/v1/tasks/', 'verb' => 'GET'],
['name' => 'collector#details', 'url' => '/api/v1/tasks/{taskId}', 'verb' => 'GET'],
['name' => 'collector#getTaskInfo', 'url' => '/api/v1/tasks/{taskId}/info', 'verb' => 'GET'],
['name' => 'collector#deleteTaskDetail', 'url' => '/api/v1/tasks/{taskId}/detail/{taskDetailId}', 'verb' => 'DELETE'],
['name' => 'collector#getGroupFilesInfo', 'url' => '/api/v1/tasks/{taskId}/files/{taskDetailId}', 'verb' => 'GET'],
['name' => 'collector#getDetailFilesTotalSize', 'url' => '/api/v1/tasks/{taskId}/filestotal', 'verb' => 'GET'],
['name' => 'collector#deleteTaskDetailFile', 'url' => '/api/v1/tasks/{taskId}/files/{taskDetailId}/{fileId}', 'verb' => 'DELETE'],
['name' => 'collector#deleteTask', 'url' => '/api/v1/tasks/{taskId}', 'verb' => 'DELETE'],
['name' => 'collector#terminateTask', 'url' => '/api/v1/tasks/{taskId}/terminate', 'verb' => 'POST'],
['name' => 'collector#collect', 'url' => '/api/v1/tasks/run', 'verb' => 'POST'],
['name' => 'collector#restart', 'url' => '/api/v1/tasks/restart', 'verb' => 'POST'],
]
];
11 changes: 11 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
plugins: ['@babel/plugin-syntax-dynamic-import'],
presets: [
[
'@babel/preset-env',
{
modules: false
}
]
]
}
21 changes: 21 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "nextcloud/mediadc",
"config": {
"optimize-autoloader": true,
"classmap-authoritative": true,
"platform": {
"php": "7.4"
}
},
"scripts": {
"cs:fix": "php-cs-fixer fix",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
"psalm": "psalm.phar"
},
"require-dev": {
"nextcloud/coding-standard": "^0.5.0",
"christophwurst/nextcloud": "v21.0.0",
"psalm/phar": "^4.6"
}
}
Loading