Skip to content

Make AudioTrackInfo opt-in to improve maintainability #180

@Currypan1229

Description

@Currypan1229

Make AudioTrackInfo opt-in to improve extensibility and maintainability.
To achieve commonality/standardization, we will prepare numerous interfaces for obtaining various types of information.
It may seem excessive, but I believe this is also one solution/answer.

implement interfaces that list various information

  • IAudioTrackInfo
  • IAuthorInfo: nullable
    for example:
IContentInfo {
 IAudioTrackInfo getAudioTrackInfo();
 IAuthorInfo getAuthorInfo()
}
IYoutubeContentInfo extends IContentInfo {
@Override
 IYoutubeAudioTrackInfo getAudioTrackInfo();
@Override
 IYoutubeAuthorInfo getAuthorInfo()
}

Implement interfaces that can get the following information (written impl interfaces below)

  • IAudioTrackInfo (getIdentifairAsString, getLength) basically
    (Since identifair can be something other than a string depending on the service, it would be clearer to add “AsString” as suffix)
  • INetworkAudioTrackInfo (isStream: default=false)
  • IArtworkedAudioTrackInfo (getArtworksInfo)
  • IAudioSrcAudioTrackInfo ()
  • IVideoSrcAudioTrackInfo (getAudioSrces: IAudioSources)
  • IsrcAudioTrackInfo (getVideoSrces: IVideoSources)

Implements classes extended AudioTrackInfo interfaces
for example;

interface IYoutubeAudioTrackInfo implements IAudioTrackInfo, IArtworkAudioTrackInfo, IAudioUriAudioTrackInfo, IVideoUriAudioTrackInfo, ISrcAudioTrackInfo {
 long getLikes();
 long getDislikes();
 long getViews();
}

For features like "Like" that exist in some services, it would be better to prepare interfaces.

author track info interfaces (written impl interfaces below)

  • IAuthorInfo (getIdentifairAsString, getDisplayName)
  • IFollowableAuthorInfo (getFollowers: long)
    for example;
interface IYoutubeAuthorInfo implements IAudioInfo, IFollowableInfo {
 long getDislikes();
 long getViews();
}

for audio source interfaces...

IAudioSources (written impl method bellow)

  • getBestAudioSource, getMaxAudioSource: IAudioSource, getMinAudioSource: IAudioSource, getAudioSources: IAudioSource[]
    IAudioSource (written impl interface below)
  • IUriAudioSources (getUri)
  • IBitratedAudioSources (getBitrate)
  • INamedAudioSources (getName; for big, small, best)

Implement video in the same way as audio.

for artwork interfaces...

IArtworksInfo (written impl field below)

  • artwork array | getMaxArtwork: IArtwork, getMinArtwork: IArtwork, getArtworks: IArtwork[]
    IArtwork (written extended interfaces bellow)
  • IEmbededArtwork
  • IUriArtwork
  • ISizedArtwork

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions