Class: TrackOrigin

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
TrackExtender
Defined in:
lib/ting_model/track_origin.rb

Instance Method Summary collapse

Methods included from TrackExtender

next_id

Instance Method Details

#dig_status_dispObject

去发现页状态显示



190
191
192
193
194
195
196
197
198
199
# File 'lib/ting_model/track_origin.rb', line 190

def dig_status_disp
  case self.dig_status
  when 0
    '待去'
  when 1
    ''
  when 2
    '不去'
  end      
end

#is_crawler_dispObject



147
148
149
150
151
152
153
154
# File 'lib/ting_model/track_origin.rb', line 147

def is_crawler_disp
  case self.is_crawler
    when true
      '爬虫'
    when false
      '用户'
  end
end

#is_publish_dispObject



156
157
158
159
160
161
162
163
164
165
# File 'lib/ting_model/track_origin.rb', line 156

def is_publish_disp
  case self.is_publish
    when true
      '审核通过'
    when false
      '审核不通过'
    else
      '审核通过'
  end
end

#is_v_dispObject

是否加V



202
203
204
205
206
207
208
209
# File 'lib/ting_model/track_origin.rb', line 202

def is_v_disp
  case self.is_v
  when true
    ""
  when false
    ""
  end          
end

#to_topic_hashObject



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/ting_model/track_origin.rb', line 86

def to_topic_hash
  {
    created_at: self.created_at,
    updated_at: self.updated_at,
    id: self.id,
    uid: self.uid,
    nickname: self.nickname,
    avatar_path: self.avatar_path,
    is_v: self.is_v,
    human_category_id: self.human_category_id,
    is_public: self.is_public,
    is_publish: self.is_publish,
    user_source: self.user_source,
    category_id: self.category_id,
    tags: self.tags,
    title: self.title,
    intro: self.intro,
    cover_path: self.cover_path,
    duration: self.duration,
    download_path: self.download_path,
    play_path: self.play_path,
    play_path_32: self.play_path_32,
    play_path_64: self.play_path_64,
    play_path_128: self.play_path_128,
    singer: self.singer,
    singer_category: self.singer_category,
    author: self.author,
    composer: self.composer,
    arrangement: self.arrangement,
    post_production: self.post_production,
    lyric: self.lyric,
    lyric_path: self.lyric_path,
    language: self.language,
    resinger: self.resinger,
    announcer: self.announcer,
    access_password: self.access_password,
    allow_download: self.allow_download,
    allow_comment: self.allow_comment,
    is_crawler: self.is_crawler,
    inet_aton_ip: self.inet_aton_ip,
    upload_source: self.upload_source,
    longitude: self.longitude,
    latitude: self.latitude,
    album_id: self.album_id,
    album_title: self.album_title,
    album_cover_path: self.album_cover_path,
    transcode_state: self.transcode_state,
    music_category: self.music_category,
    short_intro: self.short_intro,
    dig_status: self.dig_status,
    approved_at: self.approved_at,
    is_deleted: self.is_deleted,
    mp3size: self.mp3size,
    mp3size_32: self.mp3size_32,
    mp3size_64: self.mp3size_64,
    waveform: self.waveform,
    upload_id: self.upload_id,
    status: self.status
  }
end

#track_status_dispObject

审核状态



212
213
214
215
216
217
218
219
220
221
# File 'lib/ting_model/track_origin.rb', line 212

def track_status_disp
  case status
  when 0
    "待审核"
  when 1
    "通过"
  when 2
    "不通过"
  end
end

#upload_source_dispObject



178
179
180
181
182
183
184
185
186
187
# File 'lib/ting_model/track_origin.rb', line 178

def upload_source_disp
  case self.upload_source
    when 1
      'ios'
    when 2
      '电脑'
    when 3
      'android'
  end
end

#user_source_dispObject



167
168
169
170
171
172
173
174
175
176
# File 'lib/ting_model/track_origin.rb', line 167

def user_source_disp
  case user_source
    when 1
      '原创'
    when 2
      '采集'
    else
      ''
  end
end