Comments (2)
Hi,
I'm not sure what you asking, are you unable to access the additional data field?
You can access them with the following code:
$result = $synology->getList('/home', 25, 0, 'name', 'asc', '', 'all', true);
foreach($result->files as $file){
echo 'Name: '.$file->name.PHP_EOL;
echo 'Path: '.$file->path.PHP_EOL;
echo 'atime: '.$file->additional->time->atime.PHP_EOL;
echo 'crtime: '.$file->additional->time->crtime.PHP_EOL;
echo 'ctime: '.$file->additional->time->ctime.PHP_EOL;
echo 'mtime: '.$file->additional->time->mtime.PHP_EOL.PHP_EOL;
}
Now if you want to filter the result based on any additional field (including time), the FileStation API doesn't allow that.
You can only retrieve additional parameter, you cannot use them to filter result.
FileStation has a search API that I didn't implement yet, that can search for range of date on mtime, crtime and atime. However it's a bit complicated, you have to "start" a search with one call to the API, then you can poll the result with a second call, but the search might not be 100% done so you will have to poll a gain. Then you can stop the search and you have to clean the search API at some point. All of that seems a bit complicated for just a filter by date.
In your case I would sort by date to get the recent files, filter the one you need, then re sort them by name in PHP. I'm guessing this would be the best case scenario.
from synology.
Ah, yeah this is the work around that I implemented as well. I looked into the Search API but as you mentioned it is quite inefficient way of doing it. It is smarter for me to just occasionally purge the number of files in this directory.
I will look into the performance of both approaches. If its too much, I will just put it into a file and cache it. I think its rather silly restriction of Synology its API, I will get in touch with them to see if they might consider adding support for this.
I am going to close this issue, since the issue does not originate from this api.
from synology.
Related Issues (17)
- Example for DSM HOT 4
- Problem on login with new DSM 5.1 HOT 4
- destination option in downloadStation Api
- Authentication fails if secure
- Help request
- Throw error codes instead of exceptions
- Composer integration HOT 2
- Surveillance Station API -> SetCameraSchedule HOT 1
- class Synology_Abstract (Abstract.php) contains never used private $_errorCodes HOT 2
- Note Station API
- Class "Synology\Api" not found
- does this still work? HOT 1
- Connect timeout HOT 1
- Cannot connect to Synology HOT 1
- Problem with method download & Filestation API HOT 3
- Added support for BT Search HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from synology.