Class AudioDataSource

java.lang.Object
java.lang.Thread
yearreview.app.data.sources.DataSource
yearreview.app.data.sources.audio.AudioDataSource
All Implemented Interfaces:
Runnable

public class AudioDataSource extends DataSource
A DataSource that uses adapters to load the listening-history from files exported from services like Spotify.
Author:
ColdStone37
  • Field Details

  • Constructor Details

    • AudioDataSource

      public AudioDataSource(XmlNode c)
      Constructs a new AudioDataSource from a given configuration.
      Parameters:
      c - configuration to use
  • Method Details

    • parseConfig

      public void parseConfig(XmlNode config)
      Parses the passed configuration, initializes the databse and creates the adapters.
      Specified by:
      parseConfig in class DataSource
      Parameters:
      config - configuration to parse
    • loadData

      public void loadData(Instant start, Instant end) throws IOException
      Loads the data from the adapters.
      Specified by:
      loadData in class DataSource
      Parameters:
      start - start of interval to load data from
      end - end of interval to load data from
      Throws:
      IOException - if the data cannot be loaded
    • getTopListAdapter

      public TopListAdapter getTopListAdapter(AudioData.Type type)
      Gets the TopListAdapter for the AudioDatabase that can be used to create a TopList from this DataSource.
      Parameters:
      type - type of data to filter the TopList by
      Returns:
      adapter for the TopList