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

Receive and save the latest media files. #30

Merged
merged 7 commits into from
Jan 30, 2018
Merged

Receive and save the latest media files. #30

merged 7 commits into from
Jan 30, 2018

Conversation

bondrogeen
Copy link
Contributor

No description provided.

Receive and save the latest media files.
Creating the folder "tmp/< nameAdapter_ [index] >"
@Apollon77
Copy link
Member

I had a look into it. I personally would prefer that the directory for storage can be configured via an adapter config option like for other adapters. So allow absolute path's and all relative path should be automatically relative to "iobroker-data" directory. Can you change that please that way? Thank you for your contribution.

You can check iobroker.history for the "path-logic" and how to get the path

@bondrogeen
Copy link
Contributor Author

bondrogeen commented Jan 30, 2018

Okay, I'll add the ability to change the path to the folder.
Is the default path changed from "opt/iobroker/tmp" to "opt/iobroker/iobroker-data/tmp"?

@Apollon77
Copy link
Member

Why temp?! use pushover-media or such? :-)

@bondrogeen
Copy link
Contributor Author

I planned to store only the last received files from telegrams.
For example, the ability to send voice to recognition.

Do you want to use adapter.telegram to send and store media files?

@Apollon77
Copy link
Member

I have no need at all for medias (currently), only thoughtabout possible usage.
When you only store one file ... who cleans the directory?

@bondrogeen
Copy link
Contributor Author

The last files are overwritten each time.
Just stored in the directories tmp/nameadapter_ [index]

main.js Outdated
bot.getFileLink(file_id).then(function (url) {
adapter.log.debug('Received message: ' + url);
https.get(url, function (res) {
if (res.statusCode == 200) {
Copy link
Member

Choose a reason for hiding this comment

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

if (res.statusCode === 200)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

corrected the mistake

io-package.json Outdated
"type": "state",
"common": {
"role": "text",
"name": "Users as json, which are constantly authenticated",
Copy link
Member

Choose a reason for hiding this comment

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

??? Is the name right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

corrected the mistake

@GermanBluefox GermanBluefox merged commit 5931afd into iobroker-community-adapters:master Jan 30, 2018
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.

3 participants