iobroker.foobar2000 2.0.4 → 2.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintignore ADDED
@@ -0,0 +1,2 @@
1
+ **/.eslintrc.js
2
+ admin/words.js
@@ -0,0 +1,17 @@
1
+ # Configure here which dependency updates should be merged automatically.
2
+ # The recommended configuration is the following:
3
+ - match:
4
+ # Only merge patches for production dependencies
5
+ dependency_type: production
6
+ update_type: "semver:patch"
7
+ - match:
8
+ # Except for security fixes, here we allow minor patches
9
+ dependency_type: production
10
+ update_type: "security:minor"
11
+ - match:
12
+ # and development dependencies can have a minor update, too
13
+ dependency_type: development
14
+ update_type: "semver:minor"
15
+
16
+ # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see:
17
+ # https://dependabot.com/docs/config-file/#automerged_updates
@@ -0,0 +1,18 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ time: "04:00"
8
+ timezone: Europe/Berlin
9
+ open-pull-requests-limit: 15
10
+ versioning-strategy: increase
11
+
12
+ - package-ecosystem: github-actions
13
+ directory: "/"
14
+ schedule:
15
+ interval: weekly
16
+ time: "04:00"
17
+ timezone: Europe/Berlin
18
+ open-pull-requests-limit: 15
@@ -0,0 +1,27 @@
1
+ # Automatically merge Dependabot PRs when version comparison is within the range
2
+ # that is configured in .github/auto-merge.yml
3
+
4
+ name: Auto-Merge Dependabot PRs
5
+
6
+ on:
7
+ # WARNING: This needs to be run in the PR base, DO NOT build untrusted code in this action
8
+ # details under https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/
9
+ pull_request_target:
10
+
11
+ jobs:
12
+ auto-merge:
13
+ if: github.actor == 'dependabot[bot]'
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Checkout code
17
+ uses: actions/checkout@v4
18
+
19
+ - name: Check if PR should be auto-merged
20
+ uses: ahmadnassri/action-dependabot-auto-merge@v2
21
+ with:
22
+ # In order to use this, you need to go to https://github.com/settings/tokens and
23
+ # create a Personal Access Token with the permission "public_repo".
24
+ # Enter this token in your repository settings under "Secrets" and name it AUTO_MERGE_TOKEN
25
+ github-token: ${{ secrets.AUTO_MERGE_TOKEN }}
26
+ # By default, squash and merge, so Github chooses nice commit messages
27
+ command: squash and merge
@@ -5,14 +5,19 @@ name: Test and Release
5
5
  on:
6
6
  push:
7
7
  branches:
8
- - "*"
8
+ - 'master'
9
9
  tags:
10
10
  # normal versions
11
- - "v[0-9]+.[0-9]+.[0-9]+"
11
+ - 'v[0-9]+.[0-9]+.[0-9]+'
12
12
  # pre-releases
13
- - "v[0-9]+.[0-9]+.[0-9]+-**"
13
+ - 'v[0-9]+.[0-9]+.[0-9]+-**'
14
14
  pull_request: {}
15
15
 
16
+ # Cancel previous PR/branch runs when a new commit is pushed
17
+ concurrency:
18
+ group: ${{ github.ref }}
19
+ cancel-in-progress: true
20
+
16
21
  jobs:
17
22
  # Performs quick checks before the expensive test runs
18
23
  check-and-lint:
@@ -20,117 +25,68 @@ jobs:
20
25
 
21
26
  runs-on: ubuntu-latest
22
27
 
23
- strategy:
24
- matrix:
25
- node-version: [14.x]
26
-
27
28
  steps:
28
- - name: Checkout code
29
- uses: actions/checkout@v2
30
-
31
- - name: Use Node.js ${{ matrix.node-version }}
32
- uses: actions/setup-node@v1
29
+ - uses: ioBroker/testing-action-check@v1
33
30
  with:
34
- node-version: ${{ matrix.node-version }}
35
-
36
- - name: Install Dependencies
37
- run: npm i
38
-
39
- - name: Lint source code
40
- run: npm run lint
41
- - name: Test package files
42
- run: npm run test:package
31
+ node-version: '18.x'
32
+ # Uncomment the following line if your adapter cannot be installed using 'npm ci'
33
+ # install-command: 'npm install'
34
+ lint: true
43
35
 
44
36
  # Runs adapter tests on all supported node versions and OSes
45
37
  adapter-tests:
46
38
  if: contains(github.event.head_commit.message, '[skip ci]') == false
47
39
 
48
- needs: [check-and-lint]
49
-
50
40
  runs-on: ${{ matrix.os }}
51
41
  strategy:
52
42
  matrix:
53
- node-version: [10.x, 12.x, 14.x]
43
+ node-version: [16.x, 18.x, 20.x]
54
44
  os: [ubuntu-latest, windows-latest, macos-latest]
55
45
 
56
46
  steps:
57
- - name: Checkout code
58
- uses: actions/checkout@v2
59
-
60
- - name: Use Node.js ${{ matrix.node-version }}
61
- uses: actions/setup-node@v1
47
+ - uses: ioBroker/testing-action-adapter@v1
62
48
  with:
63
49
  node-version: ${{ matrix.node-version }}
50
+ os: ${{ matrix.os }}
51
+ # Uncomment the following line if your adapter cannot be installed using 'npm ci'
52
+ # install-command: 'npm install'
64
53
 
65
- - name: Install Dependencies
66
- run: npm i
54
+ # TODO: To enable automatic npm releases, create a token on npmjs.org
55
+ # Enter this token as a GitHub secret (with name NPM_TOKEN) in the repository options
56
+ # Then uncomment the following block:
67
57
 
68
- - name: Run unit tests
69
- run: npm run test:unit
58
+ # Deploys the final package to NPM
59
+ deploy:
60
+ needs: [check-and-lint, adapter-tests]
70
61
 
71
- - name: Run integration tests (unix only)
72
- if: startsWith(runner.OS, 'windows') == false
73
- run: DEBUG=testing:* npm run test:integration
62
+ # Trigger this step only when a commit on any branch is tagged with a version number
63
+ if: |
64
+ contains(github.event.head_commit.message, '[skip ci]') == false &&
65
+ github.event_name == 'push' &&
66
+ startsWith(github.ref, 'refs/tags/v')
74
67
 
75
- - name: Run integration tests (windows only)
76
- if: startsWith(runner.OS, 'windows')
77
- run: set DEBUG=testing:* & npm run test:integration
68
+ runs-on: ubuntu-latest
78
69
 
79
- # TODO: To enable automatic npm releases, create a token on npmjs.org
80
- # Enter this token as a GitHub secret (with name NPM_TOKEN) in the repository options
81
- # Then uncomment the following block:
70
+ # Write permissions are required to create Github releases
71
+ permissions:
72
+ contents: write
82
73
 
83
- # # Deploys the final package to NPM
84
- # deploy:
85
- # needs: [adapter-tests]
86
- #
87
- # # Trigger this step only when a commit on master is tagged with a version number
88
- # if: |
89
- # contains(github.event.head_commit.message, '[skip ci]') == false &&
90
- # github.event_name == 'push' &&
91
- # github.event.base_ref == 'refs/heads/master' &&
92
- # startsWith(github.ref, 'refs/tags/v')
93
- #
94
- # runs-on: ubuntu-latest
95
- # strategy:
96
- # matrix:
97
- # node-version: [14.x]
98
- #
99
- # steps:
100
- # - name: Checkout code
101
- # uses: actions/checkout@v2
102
- #
103
- # - name: Use Node.js ${{ matrix.node-version }}
104
- # uses: actions/setup-node@v1
105
- # with:
106
- # node-version: ${{ matrix.node-version }}
107
- #
108
- # - name: Extract the version and commit body from the tag
109
- # # The body may be multiline, therefore newlines and % need to be escaped
110
- # run: |
111
- # VERSION="${{ github.ref }}"
112
- # VERSION=${VERSION##*/v}
113
- # echo "::set-env name=VERSION::$VERSION"
114
- # BODY=$(git show -s --format=%b)
115
- # BODY="${BODY//'%'/'%25'}"
116
- # BODY="${BODY//$'\n'/'%0A'}"
117
- # BODY="${BODY//$'\r'/'%0D'}"
118
- # echo "::set-env name=BODY::$BODY"
119
- #
120
- # - name: Publish package to npm
121
- # run: |
122
- # npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
123
- # npm whoami
124
- # npm publish
125
- #
126
- # - name: Create Github Release
127
- # uses: actions/create-release@v1
128
- # env:
129
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130
- # with:
131
- # tag_name: ${{ github.ref }}
132
- # release_name: Release v${{ env.VERSION }}
133
- # draft: false
134
- # # Prerelease versions create prereleases on Github
135
- # prerelease: ${{ contains(env.VERSION, '-') }}
136
- # body: ${{ env.BODY }}
74
+ steps:
75
+ - uses: ioBroker/testing-action-deploy@v1
76
+ with:
77
+ node-version: '18.x'
78
+ # Uncomment the following line if your adapter cannot be installed using 'npm ci'
79
+ # install-command: 'npm install'
80
+ npm-token: ${{ secrets.NPM_TOKEN }}
81
+ github-token: ${{ secrets.GITHUB_TOKEN }}
82
+
83
+ # When using Sentry for error reporting, Sentry can be informed about new releases
84
+ # To enable create a API-Token in Sentry (User settings, API keys)
85
+ # Enter this token as a GitHub secret (with name SENTRY_AUTH_TOKEN) in the repository options
86
+ # Then uncomment and customize the following block:
87
+ # sentry: true
88
+ # sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
89
+ # sentry-project: "iobroker-pid"
90
+ # sentry-version-prefix: "iobroker.pid"
91
+ # # If your sentry project is linked to a GitHub repository, you can enable the following option
92
+ # # sentry-github-integration: true
@@ -0,0 +1,2 @@
1
+ package.json
2
+ package-lock.json
package/.prettierrc.js ADDED
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ semi: true,
3
+ trailingComma: 'all',
4
+ singleQuote: true,
5
+ printWidth: 120,
6
+ useTabs: false,
7
+ tabWidth: 4,
8
+ endOfLine: 'lf',
9
+ };
@@ -0,0 +1,3 @@
1
+ {
2
+ "plugins": ["iobroker", "license", "manual-review"]
3
+ }
package/LICENSE CHANGED
@@ -1,5 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
+ Copyright (c) 2023 iobroker-community-adapters <mcm57@gmx.at>
3
4
  Copyright (c) 2021 instalator <vvvalt@mail.ru>
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
package/README.md CHANGED
@@ -1,61 +1,87 @@
1
1
  ![Logo](admin/foobar2000.png)
2
- # Foobar2000 adapter for iobroker
3
- ![Number of Installations](http://iobroker.live/badges/foobar2000-installed.svg) ![Number of Installations](http://iobroker.live/badges/foobar2000-stable.svg) [![NPM version](https://img.shields.io/npm/v/iobroker.foobar2000.svg)](https://www.npmjs.com/package/iobroker.foobar2000)
4
- [![Downloads](https://img.shields.io/npm/dm/iobroker.foobar2000.svg)](https://www.npmjs.com/package/iobroker.foobar2000)
5
- [![Tests](https://github.com/instalator/iobroker.foobar2000/workflows/Test%20and%20Release/badge.svg)](https://github.com/instalator/ioBroker.foobar2000/actions/)
6
2
 
7
- [![NPM](https://nodei.co/npm/iobroker.foobar2000.png?downloads=true)](https://nodei.co/npm/iobroker.foobar2000/)
3
+ # iobroker.foobar2000
8
4
 
9
- [![Donate](https://img.shields.io/badge/Donate-YooMoney-green)](https://sobe.ru/na/instalator)
10
- [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PFUALWTR2CTPY)
5
+ [![GitHub license](https://img.shields.io/github/license/iobroker-community-adapters/ioBroker.foobar2000)](https://github.com/iobroker-community-adapters/ioBroker.foobar2000/blob/master/LICENSE)
6
+ [![Downloads](https://img.shields.io/npm/dm/iobroker.foobar2000.svg)](https://www.npmjs.com/package/iobroker.foobar2000)
7
+ ![GitHub repo size](https://img.shields.io/github/repo-size/iobroker-community-adapters/ioBroker.foobar2000)
8
+ [![Translation status](https://weblate.iobroker.net/widgets/adapters/-/foobar2000/svg-badge.svg)](https://weblate.iobroker.net/engage/adapters/?utm_source=widget)</br>
9
+ ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/iobroker-community-adapters/ioBroker.foobar2000)
10
+ ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/iobroker-community-adapters/ioBroker.foobar2000/latest)
11
+ ![GitHub last commit](https://img.shields.io/github/last-commit/iobroker-community-adapters/ioBroker.foobar2000)
12
+ ![GitHub issues](https://img.shields.io/github/issues/iobroker-community-adapters/ioBroker.foobar2000)
13
+ </br>
14
+ **Version:** </br>
15
+ [![NPM version](http://img.shields.io/npm/v/iobroker.foobar2000.svg)](https://www.npmjs.com/package/iobroker.foobar2000)
16
+ ![Current version in stable repository](https://iobroker.live/badges/foobar2000-stable.svg)
17
+ ![Number of Installations](https://iobroker.live/badges/foobar2000-installed.svg)
18
+ </br>
19
+ **Tests:** </br>
20
+ [![Test and Release](https://github.com/iobroker-community-adapters/ioBroker.foobar2000/actions/workflows/test-and-release.yml/badge.svg)](https://github.com/iobroker-community-adapters/ioBroker.foobar2000/actions/workflows/test-and-release.yml)
21
+ [![CodeQL](https://github.com/iobroker-community-adapters/ioBroker.foobar2000/actions/workflows/codeql.yml/badge.svg)](https://github.com/iobroker-community-adapters/ioBroker.foobar2000/actions/workflows/codeql.yml)
22
+
23
+ <!--
24
+ ## Sentry
25
+ **This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.**
26
+ For more details and for information how to disable the error reporting see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0.
27
+ -->
28
+
29
+ ## Foobar2000 adapter for iobroker
11
30
 
12
31
  ![admin settings.](admin/admin.png)
13
32
 
14
33
  ## Using
15
- Описание [тут](http://blog.instalator.ru/archives/541).
16
- Для управления проигрывателем необходимо установить плагин [foo_httpcontrol](https://bitbucket.org/oblikoamorale/foo_httpcontrol/downloads/).
17
- Для отображения обложки как ссылка на файл, необходимо в файле ```c:\Users\{USER}\AppData\Roaming\foobar2000\foo_httpcontrol_data\foobar2000controller\config``` изменить параметр ```albumart_prefer_embedded=0```
18
34
 
19
35
  To control the player, you must install the plugin [foo_httpcontrol](https://bitbucket.org/oblikoamorale/foo_httpcontrol/downloads/).
20
36
  To display the cover as a link to a file, in the file ```c:\Users\{USER}\AppData\Roaming\foobar2000\foo_httpcontrol_data\foobar2000controller\config``` change the parameter ```albumart_prefer_embedded = 0```
21
37
 
22
38
  ## Changelog
23
39
 
24
- #### 2.0.4
40
+ <!--
41
+ Placeholder for the next version (at the beginning of the line):
42
+ ### **WORK IN PROGRESS**
43
+ -->
44
+ ### 2.1.0-alpha.0 (2023-11-07)
45
+ * (mcm1957) Adapter requires nodejs16 or newer now.
46
+ * (mcm1957) Adapter has been moved to iobroker-community-adapters organization.
47
+ * (mcm1957) Dependencies have been updated.
48
+
49
+ ### 2.0.4
25
50
  * (instalator) fixed error
26
51
 
27
- #### 2.0.3
52
+ ### 2.0.3
28
53
  * (instalator) fixed admin error
29
54
 
30
- #### 2.0.2
55
+ ### 2.0.2
31
56
  * (instalator) fixed error
32
57
 
33
- #### 2.0.0
58
+ ### 2.0.0
34
59
  * (instalator) Completely rewritten
35
60
 
36
- #### 1.0.0
61
+ ### 1.0.0
37
62
  * (instalator) Up to stable
38
63
 
39
- #### 0.2.0
64
+ ### 0.2.0
40
65
  * (instalator) Change for widgets vis-players
41
66
 
42
- #### 0.1.2
67
+ ### 0.1.2
43
68
  * (instalator) del widgets folders
44
69
  * (instalator) change log level
45
70
  * (instalator) add news object
46
71
 
47
- #### 0.1.1
72
+ ### 0.1.1
48
73
  * (instalator) fix start, exit for local
49
74
 
50
- #### 0.1.0
75
+ ### 0.1.0
51
76
  * (instalator) beta (20.10.2016)
52
77
 
53
- #### 0.0.1
78
+ ### 0.0.1
54
79
  * (instalator) initial (12.10.2016)
55
80
 
56
81
  ## License
57
82
  The MIT License (MIT)
58
83
 
84
+ Copyright (c) 2023 iobroker-community-adapters <mcm57@gmx.at>
59
85
  Copyright (c) 2021 instalator <vvvalt@mail.ru>
60
86
 
61
87
  Permission is hereby granted, free of charge, to any person obtaining a copy
package/foobar2000.js CHANGED
@@ -1,13 +1,19 @@
1
- "use strict";
1
+ 'use strict';
2
2
  const utils = require('@iobroker/adapter-core');
3
- let http = require('http');
4
- let exec = require('child_process').exec;
5
- let adapter, foobarPath = null, timerPoll, timeout, muteVol = 100, request, old_states,
6
- states = {
7
- playlist: []
8
- };
3
+ const http = require('http');
4
+ const exec = require('child_process').exec;
5
+ let adapter;
6
+ let foobarPath = null;
7
+ let timerPoll;
8
+ let timeout;
9
+ let muteVol = 100;
10
+ let request;
11
+ let old_states;
12
+ const states = {
13
+ playlist: []
14
+ };
9
15
 
10
- let Commands = {
16
+ const Commands = {
11
17
  'play': 'Start',
12
18
  'stop': 'Stop',
13
19
  'next': 'StartNext',
@@ -40,7 +46,7 @@ function startAdapter(options){
40
46
  timerPoll && clearInterval(timerPoll);
41
47
  timeout && clearTimeout(timeout);
42
48
  try {
43
- debug('cleaned everything up...');
49
+ adapter.log.debug('cleaned everything up...');
44
50
  callback();
45
51
  } catch (e) {
46
52
  callback();
@@ -50,7 +56,7 @@ function startAdapter(options){
50
56
  if (id && state && !state.ack){
51
57
  adapter.log.debug(`state ${id} changed: ${state.val} (ack = ${state.ack})`);
52
58
  let param;
53
- id = id.split(".")[2].toString().toLowerCase();
59
+ id = id.split('.')[2].toString().toLowerCase();
54
60
  if (id === 'start' || id === 'exit'){
55
61
  launch(id);
56
62
  return;
@@ -137,14 +143,14 @@ function startAdapter(options){
137
143
  path: '/foobar2000controller/?cmd=Browse&param1=' + param + '&param2=EnqueueDirSubdirs' //&param3=browser.json
138
144
  };*/
139
145
  timeout && clearTimeout(timeout);
140
- httpGet('Browse', [param, 'EnqueueDirSubdirs'], (data) => {
146
+ httpGet('Browse', [param, 'EnqueueDirSubdirs'], (_data) => {
141
147
  timeout = setTimeout(() => {
142
148
  getPlaylist();
143
149
  }, 1000);
144
150
  });
145
151
  }
146
152
  } else {
147
- let cmd = Commands[id];
153
+ const cmd = Commands[id];
148
154
  if (cmd){
149
155
  if (param !== undefined){
150
156
  httpGet(cmd, [param]);
@@ -165,7 +171,7 @@ function httpGet(cmd, param, cb){
165
171
  params += '&param' + (i + 1) + '=' + key;
166
172
  });
167
173
  }
168
- let options = {
174
+ const options = {
169
175
  host: adapter.config.ip || '127.0.0.1',
170
176
  port: adapter.config.port || 8888,
171
177
  path: '/foobar2000controller/?cmd=' + cmd + params
@@ -355,41 +361,41 @@ function setInfoConnection(val){
355
361
  function secToText(sec){
356
362
  let res;
357
363
  let m = Math.floor(sec / 60);
358
- let s = sec % 60;
359
- let h = Math.floor(m / 60);
364
+ const s = sec % 60;
365
+ const h = Math.floor(m / 60);
360
366
  m = m % 60;
361
367
  if (h > 0){
362
- res = pad2(h) + ":" + pad2(m) + ":" + pad2(s);
368
+ res = pad2(h) + ':' + pad2(m) + ':' + pad2(s);
363
369
  } else {
364
- res = pad2(m) + ":" + pad2(s);
370
+ res = pad2(m) + ':' + pad2(s);
365
371
  }
366
372
  return res;
367
373
  }
368
374
 
369
375
  function pad2(num){
370
- let s = num.toString();
371
- return (s.length < 2) ? "0" + s :s;
376
+ const s = num.toString();
377
+ return (s.length < 2) ? '0' + s :s;
372
378
  }
373
379
 
374
380
  function getPlaylist(){
375
381
  httpGet('PlaylistItemsPerPage', [16384], (res) => {
376
382
  if (res && res.playlist){
377
- let playlist = [];
378
- let arr = res.songs;
383
+ const playlist = [];
384
+ //const arr = res.songs;
379
385
  res.playlist.forEach((key, i) => {
380
386
  playlist[i] = {
381
- "id": i + 1,
382
- "artist": key.artist,
383
- "album": key.album,
384
- "bitrate": 0,
385
- "title": key.track,
386
- "file": "",
387
- "genre": "",
388
- "year": 0,
389
- "len": key.len,
390
- "rating": key.rating,
391
- "cover": ""
392
- }
387
+ 'id': i + 1,
388
+ 'artist': key.artist,
389
+ 'album': key.album,
390
+ 'bitrate': 0,
391
+ 'title': key.track,
392
+ 'file': '',
393
+ 'genre': '',
394
+ 'year': 0,
395
+ 'len': key.len,
396
+ 'rating': key.rating,
397
+ 'cover': ''
398
+ };
393
399
  });
394
400
  states.playlist = JSON.stringify(playlist);
395
401
  states.playlists = JSON.stringify(res.playlists);
@@ -406,8 +412,8 @@ function launch(cmd){
406
412
  sendShellCommand('exit');
407
413
  }
408
414
  } else if (adapter.config.cmdstart){
409
- let parts = adapter.config.path.split(':');
410
- let options = {
415
+ const parts = adapter.config.path.split(':');
416
+ const options = {
411
417
  host: parts[0],
412
418
  port: parts[1],
413
419
  path: ''
@@ -455,18 +461,18 @@ function browser(cmd, param){
455
461
  }
456
462
 
457
463
  function filemanager(val, arr){
458
- let browser = {}, files = [];
464
+ const browser = {}, files = [];
459
465
  arr.forEach((item, i, arr) => {
460
- let obj = {};
461
- let size = parseFloat(arr[i].fs) * 1024;
466
+ const obj = {};
467
+ const size = parseFloat(arr[i].fs) * 1024;
462
468
  if (!isNaN(size)){
463
469
  obj.size = (parseFloat(arr[i].fs.replace(',', '.')) * 1024).toFixed(0);
464
470
  } else {
465
471
  obj.size = '';
466
472
  }
467
473
  if (arr[i].ft && ~arr[i].ft.indexOf(':')){
468
- let mod = arr[i].ft.split(' '); //"27.05.2004 01:50" 2016-02-27 16:05:46
469
- let d = mod[0].split('.').reverse().join('-');
474
+ const mod = arr[i].ft.split(' '); //"27.05.2004 01:50" 2016-02-27 16:05:46
475
+ const d = mod[0].split('.').reverse().join('-');
470
476
  arr[i].ft = d + ' ' + mod[1];
471
477
  }
472
478
  if (arr[i].fs){
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "foobar2000",
4
- "version": "2.0.4",
4
+ "version": "2.1.0-alpha.0",
5
5
  "news": {
6
+ "2.1.0-alpha.0": {
7
+ "en": "Adapter requires nodejs16 or newer now.\nAdapter has been moved to iobroker-community-adapters organization.\nDependencies have been updated.",
8
+ "de": "Adapter benötigt jetzt nodejs16 oder neuer.\nAdapter wurde auf iobroker-community-Adapter Organisation verschoben.\nAbhängigkeiten wurden aktualisiert.",
9
+ "ru": "Адаптер требует nodejs16 или новее теперь.\nАдаптер переехал в организацию iobroker-community-adapters.\nОбновлены зависимости.",
10
+ "pt": "Adaptador requer nodejs16 ou mais recente agora.\nAdapter foi movido para iobroker-community-adapters organização.\nAs dependências foram atualizadas.",
11
+ "nl": "Adapter vereist nodejs16 of Newer nu.\nAdapter is verplaatst naar iobroker-community-papters organisatie.\nAfhankelijkheid is geüpdateerd.",
12
+ "fr": "Adaptateur nécessite nodejs16 ou plus récent maintenant.\nL'adaptateur a été déplacé à l'organisation iobroker-community-adapters.\nLes dépendances ont été mises à jour.",
13
+ "it": "Adattatore richiede nodejs16 o più nuovo ora.\nL'adattatore è stato trasferito all'organizzazione iobroker-community-adapters.\nLe dipendenze sono state aggiornate.",
14
+ "es": "Adaptador requiere nodejs16 o nuevo ahora.\nEl adaptador ha sido trasladado a la organización de ibroker-community-adapters.\nSe han actualizado las dependencias.",
15
+ "pl": "Adapter wymaga węzłów 16 lub nowszych.\nAdapter przeniesiono do organizacji iobroker-community-adapter.\nW zależności zostały zaktualizowane.",
16
+ "uk": "Адаптер вимагає nodejs16 або новіший зараз.\nПереміщено перехід на організацію iobroker-community-adapters.\nОновлено залежність.",
17
+ "zh-cn": "道歉要求现在不再出现。.\n现已移到加勒比妓院。.\n情况已经更新。."
18
+ },
6
19
  "2.0.4": {
7
20
  "en": "fixed error",
8
21
  "de": "fixed error",
@@ -14,7 +27,8 @@
14
27
  "es": "fixed error",
15
28
  "pl": "fixed error",
16
29
  "zh-cn": "fixed error"
17
- },"2.0.3": {
30
+ },
31
+ "2.0.3": {
18
32
  "en": "fixed admin error",
19
33
  "de": "fixed admin error",
20
34
  "ru": "fixed admin error",
@@ -39,37 +53,64 @@
39
53
  "zh-cn": "Completely rewritten"
40
54
  }
41
55
  },
42
- "title": "Control foobar2000 player",
56
+ "titleLang": {
57
+ "en": "Control foobar2000 player",
58
+ "de": "Steuerung foobar2000 Player",
59
+ "ru": "Управление foobar2000 игроком",
60
+ "pt": "Control foobar2000 jogador",
61
+ "nl": "Controle:",
62
+ "fr": "Contrôle du joueur de foobar2000",
63
+ "it": "Controllo del lettore foobar2000",
64
+ "es": "Control foobar2000 jugador",
65
+ "pl": "Foobar2000 player",
66
+ "uk": "Контроль фобар2000",
67
+ "zh-cn": "控制软禁2000年"
68
+ },
43
69
  "desc": {
44
70
  "en": "Control your foobar2000 player",
45
- "de": "Steuern Sie Ihren foobar2000-Player",
46
- "ru": "Управляйте своим игроком foobar2000",
47
- "pt": "Controle o seu foobar2000 player",
48
- "nl": "Bedien uw foobar2000-speler",
71
+ "de": "Steuern Sie Ihren foobar2000 Player",
72
+ "ru": "Контролируйте своего игрока foobar2000",
73
+ "pt": "Controle o seu jogador foobar2000",
74
+ "nl": "Controleer je foobar2000 speler",
49
75
  "fr": "Contrôlez votre lecteur foobar2000",
50
- "it": "Controlla il tuo giocatore foobar2000",
51
- "es": "Controla tu reproductor foobar2000",
52
- "pl": "Kontroluj swój odtwarzacz foobar2000",
53
- "zh-cn": "控制您的foobar2000播放器"
76
+ "it": "Controlla il tuo lettore foobar2000",
77
+ "es": "Controle su jugador foobar2000",
78
+ "pl": "Kontrola nad foobar2000",
79
+ "uk": "Керуйте фобар2000",
80
+ "zh-cn": "控制你的野蛮2000年事件"
54
81
  },
55
- "license": "MIT",
56
82
  "authors": [
57
- "instalator"
83
+ "instalator",
84
+ "iobroker-community-adapters <mcm57@gmx.at>"
85
+ ],
86
+ "keywords": [
87
+ "foobar2000",
88
+ "player"
58
89
  ],
90
+ "license": "MIT",
59
91
  "platform": "Javascript/Node.js",
60
- "mode": "daemon",
92
+ "main": "foobar2000.js",
61
93
  "icon": "foobar2000.png",
62
94
  "enabled": false,
63
- "compact": true,
64
- "materialize": true,
95
+ "extIcon": "https://raw.githubusercontent.com/iobroker-community-adapters/iobroker.foobar2000/master/admin/foobar2000.png",
96
+ "readme": "https://github.com/iobroker-community-adapters/iobroker.foobar2000/blob/master/README.md",
65
97
  "loglevel": "info",
98
+ "mode": "daemon",
66
99
  "type": "multimedia",
67
- "extIcon": "https://raw.githubusercontent.com/instalator/iobroker.foobar2000/master/admin/foobar2000.png",
68
- "keywords": [
69
- "foobar2000",
70
- "player"
100
+ "compact": true,
101
+ "connectionType": "local",
102
+ "dataSource": "pull",
103
+ "materialize": true,
104
+ "dependencies": [
105
+ {
106
+ "js-controller": ">=4.0.24"
107
+ }
71
108
  ],
72
- "readme": "https://github.com/instalator/iobroker.foobar2000/blob/master/README.md"
109
+ "globalDependencies": [
110
+ {
111
+ "admin": ">=5.1.13"
112
+ }
113
+ ]
73
114
  },
74
115
  "native": {
75
116
  "ip": "127.0.0.1",
@@ -403,7 +444,11 @@
403
444
  "read": true,
404
445
  "write": true,
405
446
  "def": false,
406
- "states": {"0": "Off", "1": "All", "2": "One"}
447
+ "states": {
448
+ "0": "Off",
449
+ "1": "All",
450
+ "2": "One"
451
+ }
407
452
  },
408
453
  "native": {}
409
454
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.foobar2000",
3
- "version": "2.0.4",
3
+ "version": "2.1.0-alpha.0",
4
4
  "description": "ioBroker Foobar2000 player adapter",
5
5
  "author": {
6
6
  "name": "instalator",
@@ -10,9 +10,13 @@
10
10
  {
11
11
  "name": "instalator",
12
12
  "email": "vvvalt@mail.ru"
13
+ },
14
+ {
15
+ "name": "iobroker-community-adapters",
16
+ "email": "mcm57@gmx.at"
13
17
  }
14
18
  ],
15
- "homepage": "https://github.com/instalator/iobroker.foobar2000",
19
+ "homepage": "https://github.com/iobroker-community-adapters/iobroker.foobar2000",
16
20
  "license": "MIT",
17
21
  "keywords": [
18
22
  "ioBroker",
@@ -22,42 +26,54 @@
22
26
  ],
23
27
  "repository": {
24
28
  "type": "git",
25
- "url": "https://github.com/instalator/ioBroker.foobar2000.git"
29
+ "url": "https://github.com/iobroker-community-adapters/ioBroker.foobar2000.git"
30
+ },
31
+ "engines": {
32
+ "node": ">=16"
26
33
  },
27
34
  "dependencies": {
28
- "@iobroker/adapter-core": "^2.4.0"
35
+ "@iobroker/adapter-core": "^3.0.4"
29
36
  },
30
37
  "devDependencies": {
31
- "@iobroker/testing": "^2.4.2",
32
- "@types/chai": "^4.2.14",
33
- "@types/chai-as-promised": "^7.1.3",
34
- "@types/gulp": "^4.0.8",
35
- "@types/mocha": "^8.2.0",
36
- "@types/node": "^14.14.25",
37
- "@types/proxyquire": "^1.3.28",
38
- "@types/sinon": "^9.0.10",
39
- "@types/sinon-chai": "^3.2.5",
40
- "axios": "^0.21.1",
41
- "chai": "^4.3.0",
38
+ "@alcalzone/release-script": "^3.6.0",
39
+ "@alcalzone/release-script-plugin-iobroker": "^3.6.0",
40
+ "@alcalzone/release-script-plugin-license": "^3.5.9",
41
+ "@alcalzone/release-script-plugin-manual-review": "^3.5.9",
42
+ "@iobroker/adapter-dev": "^1.2.0",
43
+ "@iobroker/testing": "^4.1.0",
44
+ "@tsconfig/node14": "^14.1.0",
45
+ "@types/chai": "^4.3.8",
46
+ "@types/chai-as-promised": "^7.1.6",
47
+ "@types/mocha": "^10.0.2",
48
+ "@types/node": "^20.8.6",
49
+ "@types/proxyquire": "^1.3.29",
50
+ "@types/sinon": "^17.0.0",
51
+ "@types/sinon-chai": "^3.2.10",
52
+ "chai": "^4.3.10",
42
53
  "chai-as-promised": "^7.1.1",
43
- "eslint": "^7.19.0",
44
- "gulp": "^4.0.2",
45
- "mocha": "^8.2.1",
54
+ "eslint": "^8.51.0",
55
+ "eslint-config-prettier": "^8.9.0",
56
+ "eslint-plugin-prettier": "^4.2.1",
57
+ "mocha": "^10.2.0",
58
+ "prettier": "^3.0.3",
46
59
  "proxyquire": "^2.1.3",
47
- "sinon": "^9.2.4",
48
- "sinon-chai": "^3.5.0"
60
+ "sinon": "^17.0.1",
61
+ "sinon-chai": "^3.7.0",
62
+ "typescript": "~5.2.2"
49
63
  },
50
64
  "main": "foobar2000.js",
51
65
  "scripts": {
52
- "test:js": "mocha \"{!(node_modules|test)/**/*.test.js,*.test.js,test/**/test!(PackageFiles|Startup).js}\"",
66
+ "test:js": "mocha --config test/mocharc.custom.json \"{!(node_modules|test)/**/*.test.js,*.test.js,test/**/test!(PackageFiles|Startup).js}\"",
53
67
  "test:package": "mocha test/package --exit",
54
- "test:unit": "mocha test/unit --exit",
55
68
  "test:integration": "mocha test/integration --exit",
56
69
  "test": "npm run test:js && npm run test:package",
57
- "lint": "eslint"
70
+ "check": "tsc --noEmit -p tsconfig.check.json",
71
+ "lint": "eslint .",
72
+ "translate": "translate-adapter",
73
+ "release": "release-script"
58
74
  },
59
75
  "bugs": {
60
- "url": "https://github.com/instalator/iobroker.foobar2000/issues"
76
+ "url": "https://github.com/iobroker-community-adapters/iobroker.foobar2000/issues"
61
77
  },
62
78
  "readmeFilename": "README.md"
63
79
  }
package/.mocharc.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "require": [
3
- "./test/mocha.setup.js"
4
- ],
5
- "watch-files": [
6
- "!(node_modules|test)/**/*.test.js",
7
- "*.test.js",
8
- "test/**/test!(PackageFiles|Startup).js"
9
- ]
10
- }