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

Skip external mounts with disabled previews #190

Merged
merged 3 commits into from Dec 6, 2021

Conversation

hashworks
Copy link
Contributor

For external storage mounts one can disable previews:
setting

This change respects this setting and skips folders with disabled previews:

2020-05-04T15:52:15+00:00 Scanning folder /hashworks/files
2020-05-04T15:52:15+00:00 Skipping folder /hashworks/files/NoMedia
2020-05-04T15:52:15+00:00 Scanning folder /hashworks/files/Photos
[...]
2020-05-04T15:52:15+00:00 Skipping folder /hashworks/files/GDrive

Resolves #151.

@hashworks
Copy link
Contributor Author

Please note that the CI fails because it's using an old PHP version: This version of Nextcloud requires at least PHP 7.2<br/>You are currently running 7.0.33. Please update your PHP version.

@hashworks
Copy link
Contributor Author

Additionally, the 7.2 test fails because of a PHPUnit error:

$ sh -c "phpunit --configuration phpunit.xml"
PHP Fatal error:  Declaration of OCA\PreviewGenerator\Tests\WatcherTest::setUp() must be compatible with Test\TestCase::setUp(): void in /home/travis/build/rullzer/server/apps/previewgenerator/tests/WatcherTest.php on line 37
PHP Stack trace:
PHP   1. {main}() /home/travis/build/rullzer/vendor/phpunit/phpunit/phpunit:0
PHP   2. PHPUnit\TextUI\Command::main() /home/travis/build/rullzer/vendor/phpunit/phpunit/phpunit:61
PHP   3. PHPUnit\TextUI\Command->run() /home/travis/build/rullzer/vendor/phpunit/phpunit/src/TextUI/Command.php:163
PHP   4. PHPUnit\TextUI\Command->handleArguments() /home/travis/build/rullzer/vendor/phpunit/phpunit/src/TextUI/Command.php:171
PHP   5. PHPUnit\Util\Configuration->getTestSuiteConfiguration() /home/travis/build/rullzer/vendor/phpunit/phpunit/src/TextUI/Command.php:929
PHP   6. PHPUnit\Util\Configuration->getTestSuite() /home/travis/build/rullzer/vendor/phpunit/phpunit/src/Util/Configuration.php:874
PHP   7. PHPUnit\Framework\TestSuite->addTestFiles() /home/travis/build/rullzer/vendor/phpunit/phpunit/src/Util/Configuration.php:1005
PHP   8. PHPUnit\Framework\TestSuite->addTestFile() /home/travis/build/rullzer/vendor/phpunit/phpunit/src/Framework/TestSuite.php:452
PHP   9. PHPUnit\Util\FileLoader::checkAndLoad() /home/travis/build/rullzer/vendor/phpunit/phpunit/src/Framework/TestSuite.php:354
PHP  10. PHPUnit\Util\FileLoader::load() /home/travis/build/rullzer/vendor/phpunit/phpunit/src/Util/FileLoader.php:47
PHP  11. include_once() /home/travis/build/rullzer/vendor/phpunit/phpunit/src/Util/FileLoader.php:59

@hashworks
Copy link
Contributor Author

There we go :) All fixed.

@hashworks
Copy link
Contributor Author

@rullzer Anything you want me to adjust here?

@MichaIng
Copy link
Member

Great, also updating the tests PHP versions is what I just thought as well 😉.

rullzer
rullzer previously approved these changes Dec 21, 2020
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rebase on master?

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@97d0578). Click here to learn what that means.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master    #190   +/-   ##
========================================
  Coverage          ?   4.62%           
  Complexity        ?     166           
========================================
  Files             ?      16           
  Lines             ?     541           
  Branches          ?       0           
========================================
  Hits              ?      25           
  Misses            ?     516           
  Partials          ?       0           
Impacted Files Coverage Δ Complexity Δ
lib/Command/Generate.php 0.00% <0.00%> (ø) 29.00 <11.00> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97d0578...61a6a6c. Read the comment docs.

@hashworks
Copy link
Contributor Author

Rebase done.

@poisonborz
Copy link

Please someone merge this 🙏

@cClaude
Copy link

cClaude commented Apr 21, 2021

@hashworks it seem that a rebase is still required.

@rullzer is there any change to have this merged ?

@MichaIng
Copy link
Member

it seem that a rebase is still required.

Base branch is correct, only conflicts need to be resolved.

@hashworks
Copy link
Contributor Author

Rebase done.

@szaimen
Copy link

szaimen commented Sep 19, 2021

Merge?

Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break if files_external is disabled. Please make the GlobalStoragesService parameter of the constructor optional and implement checks when using it later.

@st3iny
Copy link
Member

st3iny commented Dec 1, 2021

@hashworks I can take over if you are lacking the time/interest. I really think it is a great addition to the app.

@hashworks
Copy link
Contributor Author

I'll fix this on the weekend.

@hashworks
Copy link
Contributor Author

Rebased and GlobalStoragesService made optional. Tested it, works with and without the "External storage support" app.

Signed-off-by: hashworks <mail@hashworks.net>
Signed-off-by: hashworks <mail@hashworks.net>
GlobalStoragesService is only available when the "External storage support" app
is enabled.

Signed-off-by: hashworks <mail@hashworks.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

excluding external storage folder.
8 participants