dart_tags 0.1.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 83

Dart Tags #

pub package Build Status

The library for parsing ID3 tags, written in pure Dart.

You can found sample app written with flutter framework here.

License #

project under MIT license

Changelogs #

full changelog

0.1.0 #

  • added writers (currently v2 writer not fully implemented)
  • fixed custom tags (TXXX / WXXX) reading
  • wrote some rough tests for writers

Instalation #

add dependency in pubsec.yaml

dependencies:
  dart_tags: ^0.1.0

Usage #

A simple usage example:

import 'dart:io';

import 'package:dart_tags/dart_tags.dart';

main(List<String> args) {
  TagProcessor tp = new TagProcessor();

  File f = new File(args[0]);
  
  tp.getTagsFromByteArray(f.readAsBytes()).then((l) => l.forEach((f) => print(f)));
}

Experimental #

And since 0.1.0 you can write some tags into the byte array:

import 'dart:io';

import 'package:dart_tags/dart_tags.dart';

main(List<String> args) {
  TagProcessor tp = new TagProcessor();

  final f = new File(args[0]);

  final tag = Tag()
    ..tags = {
      'title': 'foo',
      'artist': 'bar',
      'album': 'baz',
      'year': '2010',
      'comment': 'lol it is a comment',
      'track': '6',
      'genre': 'Dream'
    }
    ..type = 'ID3'
    ..version = '2.4';
  
  List<int> newByteArrayWithTags = tp.putTagsToByteArray(f.readAsBytes(), [tag]);
}

Features and bugs #

Please feel free for feature requests and bugs at the issue tracker.


id3v2 logo

0.0.1 #

  • Initial version
  • Supports Id3 v1.1 tags

0.0.2 #

  • Basic support of ID3 v2.4 tags
  • support main frames include APIC
  • TagProcessor now can get tags from file and from ByteData
  • You can select which type of tag do you want to get
  • Small fix in id3 v1 parser

0.0.3 #

  • Removed dependency from [dart:io]
  • Some API changes

0.0.4 #

  • Formating sources

0.0.5 #

  • Update static analyzer rules
  • API Changes: AttachedPicture.imageType now returns String value .imageTypeCode return byte value

0.0.6 #

  • Fixed compile-time issue

0.0.7 #

  • Removed assertion in parser
  • Fixed some crashes.
  • Added clearing from null bytes in id3v2 and unsync bytes
  • UTF16 crash fixed
  • Improve stability

0.0.8 #

  • added BASE64 for imageData in attached pictures
  • small changes in example
  • fix README formating

0.0.9 #

  • added ParsingException class
  • up sdk dependency in pubsec.yaml to <=3.0.0
  • wrote some tests
  • added stub mp3s for tests

0.1.0 #

  • added writers (currently v2 writer not fully implemented)
  • fixed custom tags (TXXX / WXXX) reading
  • wrote some rough tests for writers

example/example.dart

import 'dart:io';

import 'package:dart_tags/dart_tags.dart';

void main(List<String> args) {
  if (args.isNotEmpty) {
    args.forEach((s) => _proceedArg(s));
  } else {
    print('args please!');
  }
}

void _proceedArg(String path) {
  final fileType = FileStat.statSync(path).type;
  switch (fileType) {
    case FileSystemEntityType.directory:
      new Directory(path)
          .list(recursive: true, followLinks: false)
          .listen((FileSystemEntity entity) {
        if (entity.statSync().type == FileSystemEntityType.file &&
            entity.path.endsWith('.mp3')) {
          printFileInfo(entity.path);
        }
      });
      break;
    case FileSystemEntityType.file:
      if (path.endsWith('.mp3')) {
        printFileInfo(path);
      }
      break;
    case FileSystemEntityType.notFound:
      print('file not found');
      break;
    default:
      print('sorry dude I don`t know what I must to do with that...\n');
  }
}

void printFileInfo(String fileName) async {
  final file = new File(fileName);
  new TagProcessor().getTagsFromByteArray(file.readAsBytes()).then((l) {
    print('FILE: $fileName');
    l.forEach((f) => print(f));
    print('\n');
  });
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart_tags: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart_tags/dart_tags.dart';
  
Version Uploaded Documentation Archive
0.1.2 May 13, 2019 Go to the documentation of dart_tags 0.1.2 Download dart_tags 0.1.2 archive
0.1.1 Mar 22, 2019 Go to the documentation of dart_tags 0.1.1 Download dart_tags 0.1.1 archive
0.1.0 Mar 20, 2019 Go to the documentation of dart_tags 0.1.0 Download dart_tags 0.1.0 archive
0.0.9 Jul 18, 2018 Go to the documentation of dart_tags 0.0.9 Download dart_tags 0.0.9 archive
0.0.8 May 22, 2018 Go to the documentation of dart_tags 0.0.8 Download dart_tags 0.0.8 archive
0.0.7 May 14, 2018 Go to the documentation of dart_tags 0.0.7 Download dart_tags 0.0.7 archive
0.0.6 May 14, 2018 Go to the documentation of dart_tags 0.0.6 Download dart_tags 0.0.6 archive
0.0.5 May 11, 2018 Go to the documentation of dart_tags 0.0.5 Download dart_tags 0.0.5 archive
0.0.4 May 10, 2018 Go to the documentation of dart_tags 0.0.4 Download dart_tags 0.0.4 archive
0.0.3 May 10, 2018 Go to the documentation of dart_tags 0.0.3 Download dart_tags 0.0.3 archive

All 11 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
67
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
98
Overall:
Weighted score of the above. [more]
83
Learn more about scoring.

We analyzed this package on May 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.0
  • pana: 0.12.15

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:dart_tags/dart_tags.dart.

Health suggestions

Fix lib/src/model/attached_picture.dart. (-0.50 points)

Analysis of lib/src/model/attached_picture.dart reported 1 hint:

line 36 col 3: Avoid return types on setters.

Maintenance suggestions

Update README.md. (-2 points)

1 image link is insecure (e.g. http://id3.org/images/id3v2.gif), use https URLs instead.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.61.0 <3.0.0
Dev dependencies
test ^1.5.3