Return status of application Returns: status(dict): Dict with status.
(self)
| 279 | return self._audio_cache |
| 280 | |
| 281 | def status(self): |
| 282 | """Return status of application |
| 283 | |
| 284 | Returns: |
| 285 | status(dict): Dict with status. |
| 286 | """ |
| 287 | stat = {} |
| 288 | |
| 289 | stat["cache"] = {"image": {}, "audio": {}, "thumbnail": {"disk": {}, "memory": {}}, } |
| 290 | stat["session"] = {"playlist": {}, "media": {}} |
| 291 | stat["connection"] = {} |
| 292 | |
| 293 | try: |
| 294 | if self.connection.app_version is None: |
| 295 | stat["connection"]["connected"] = False |
| 296 | else: |
| 297 | # connection stats |
| 298 | stat["connection"]["connected"] = True |
| 299 | stat["connection"]["version"] = self.connection.app_version |
| 300 | stat["connection"]["application"] = self.connection.app_type |
| 301 | stat["connection"]["host"] = self.connection.host |
| 302 | stat["connection"]["port"] = self.connection.port |
| 303 | |
| 304 | stat["cache"]["image"]["count"] = self.image_cache.count |
| 305 | stat["cache"]["image"]["size"] = self.image_cache.size |
| 306 | stat["cache"]["audio"]["count"] = self.audio_cache.count |
| 307 | stat["cache"]["audio"]["size"] = self.audio_cache.size |
| 308 | stat["cache"]["thumbnail"]["disk"]["count"] = self.thumbnail.count_disk |
| 309 | stat["cache"]["thumbnail"]["disk"]["size"] = self.thumbnail.size_disk |
| 310 | stat["cache"]["thumbnail"]["memory"]["count"] = self.thumbnail.count_memory |
| 311 | stat["cache"]["thumbnail"]["memory"]["size"] = self.thumbnail.size_memory |
| 312 | |
| 313 | stat["session"]["path"] = self.app.session.path |
| 314 | stat["session"]["playlist"]["count"] = len(self.app.session.playlists) |
| 315 | stat["session"]["media"]["count"] = len(self.app.session.get_media()) |
| 316 | |
| 317 | except Exception as err: |
| 318 | print (err) |
| 319 | |
| 320 | |
| 321 | return stat |
| 322 | |
| 323 | |
| 324 | def print_status(self): |
no test coverage detected