Skip to content

Commit

Permalink
docs: remove duplicate documentation for properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpavlock committed Nov 4, 2022
1 parent 2722c9b commit 76f9b95
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/developers/api/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Library

.. automodule:: moe.library
:members:
:exclude-members: cache_ok, path, year, catalog_num, genre, original_year, audio_format
:exclude-members: cache_ok, path
:show-inheritance:


Expand Down
5 changes: 0 additions & 5 deletions moe/library/album.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class MetaAlbum(MetaLibItem):
Attributes:
artist (Optional[str]): AKA albumartist.
barcode (Optional[str]): UPC barcode.
catalog_num (Optional[str]): String of catalog numbers concatenated with ';'.
catalog_nums (Optional[set[str]]): Set of all catalog numbers.
country (Optional[str]): Country the album was released in
(two character identifier).
Expand Down Expand Up @@ -324,15 +323,11 @@ class Album(LibItem, SABase, MetaAlbum):
media (Optional[str]): Album release format (e.g. CD, Digital, etc.)
original_date (Optional[datetime.date]): Date of the original release of the
album.
original_year (Optional[int]): Album original release year. Note, this field is
read-only, set ``original_date`` instead.
path (pathlib.Path): Filesystem path of the album directory.
title (str)
track_total (Optional[int]): Number of tracks that *should* be in the album.
If an album is missing tracks, then ``len(tracks) < track_total``.
tracks (list[Track]): Album's corresponding tracks.
year (int): Album release year. Note, this field is read-only, set ``date``
instead.
"""

__tablename__ = "album"
Expand Down
21 changes: 8 additions & 13 deletions moe/library/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ class MetaTrack(MetaLibItem):
artist (Optional[str])
artists (Optional[set[str]]): Set of all artists.
disc (Optional[int]): Disc number the track is on.
genre (Optional[str]): String of all genres concatenated with ';'.
genres (Optional[set[str]]): Set of all genres.
title (Optional[str])
track_num (Optional[int])
Expand Down Expand Up @@ -316,11 +315,7 @@ class Track(LibItem, SABase, MetaTrack):
album_obj (Album): Corresponding Album object.
artist (str)
artists (Optional[set[str]]): Set of all artists.
audio_format (str): File audio format.
One of ['aac', 'aiff', 'alac', 'ape', 'asf', 'dsf', 'flac', 'ogg', 'opus',
'mp3', 'mpc', 'wav', 'wv']
disc (int): Disc number the track is on.
genre (str): String of all genres concatenated with ';'.
genres (Optional[set[str]]): Set of all genres.
path (Path): Filesystem path of the track file.
title (str)
Expand Down Expand Up @@ -482,14 +477,6 @@ def audio_format(self) -> str:
"""
return mediafile.MediaFile(self.path).type

@property
def sample_rate(self) -> int:
"""Returns the sampling rate of the track.
The sampling rate is in Hertz (Hz) as an integer and zero when unavailable.
"""
return mediafile.MediaFile(self.path).samplerate

@property
def bit_depth(self) -> int:
"""Returns the number of bits per sample in the audio encoding.
Expand All @@ -504,6 +491,14 @@ def fields(self) -> set[str]:
"""Returns any editable, track-specific fields."""
return super().fields.union({"path"})

@property
def sample_rate(self) -> int:
"""Returns the sampling rate of the track.
The sampling rate is in Hertz (Hz) as an integer and zero when unavailable.
"""
return mediafile.MediaFile(self.path).samplerate

def is_unique(self, other: "Track") -> bool:
"""Returns whether a track is unique in the library from ``other``."""
if self.path == other.path:
Expand Down

0 comments on commit 76f9b95

Please sign in to comment.